web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Exception message while executing test case in Test explorer

(4) ShareShare
ReportReport
Posted on by 40
Hi Dynamics Community,
 
I am new to Dynamics Testing and ATL. While running any test case in Visual Studio using Test Explorer, I am getting the below error. 
Message:
Exception has been thrown by the target of an invocation.
Stack Trace: 
RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) 
RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) 
AOS.StartupInternal(String[] Arguments) 
AOS.Startup() 
?A0xf2c79d70.GetAosConfig() 
Config.InitInternal() 
Config.InitOnce(Boolean isOfflineMode)
InProcExecutor.Execute() 
SysTestExecutor.RunXppTests(IEnumerable`1 tests)
Below is the code:
public class SampleTest extends SysTestCase
{
   [SysTestMethod, Hookable(false)]
   public void myTest()
   {
       this.assertTrue(true);
   }
   public void setup()
   {
       super();
   }
}
 
Please let me know if anyone is aware how to resolve.
I have the same question (1)
  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at
    Your test looks fine and the stack trace shows that the problem happens long before it could run your test; it seems that the AOS can't start at all. Does your environment work in a browser?
  • Sourav Mazumdar Profile Picture
    40 on at
    Thank you, Martin for your response.
     
    Yes, the environment is working in the browser.
  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at
    I would explore event logs; there may be some details there.
     
    How did you create the environment? For example, is it a cloud-hosted environment on the latest version? Or an UDE environment? (Or so...)
    Do your colleagues have the same problem on their machines? Consider deploying a new, clean DEV box and trying it there.
  • Sourav Mazumdar Profile Picture
    40 on at
    Hi Martin,
     
    It is a cloud-hosted environment with the latest version. But we are migrating to UDE environment.
    My colleagues are not facing this issue. 
     
    Thanks! I will check if the issue gets resolved with newly created UDE environment. 
  • Michal N Profile Picture
    3 on at
    Hello, I have the same issue in my development environment. Have you found the solution please?
  • FV@E Profile Picture
    133 on at
    Same for me, I also have the same error but haven't found a solution yet.
  • Andrew Jones a1x Profile Picture
    136 on at
    I also get this sometimes  on CHEs.
     
    I have it again currently on a box where the unit tests used to work successfully. It was recently upgrade to 10.0.44 and also refreshed with new data and I don't know if one of those actions caused it.
     
    Everything else works, the environment is available either with IIS or IISExpress. Batch server runs with no issues... I'd love to know what causes this and if anybody has found a solution.
     
    I do find that sometimes when I try again in a few weeks they are suddenly working again, but have no idea what changed in the meantime... 
     
    I feel lost without my unit tests!
     
    Any updates?
  • Suggested answer
    Andrew Jones a1x Profile Picture
    136 on at
    I have just resolved this is issue by doing a Repair on my VS 2022 installation. I'm fairly sure this doesn't always work, but who knows...
     
    The other thing to note is that after a data refresh into a CHE running the tests sometimes just gets a never-ending spinning circle and the tests never actually start.
     
    Truncating the FormRunConfiguration table in SQL server fixes this:
     
    truncate table formrunconfiguration
     
    I hope this helps somebody
     
    Andrew
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 611 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans