Seo Services
Results for C# Common Language Runtime Detected An Invalid Program

Solved, C# Common Language Runtime Detected An Invalid Program.

December 01, 2022

C# Common Language Runtime Detected An Invalid Program.


This is the oddest programming problem I've encountered in a long time.


After updating to version 15.8.0 of Visual Studio 2017 I am getting an exception when running my ASP.NET Webforms application.

The solution build without issue, but the error occurs as soon as run the application in the browser.

The following is a portion of the code (it is all simple stuff):


C# code
Code

I can still build and build the dll without any problems, but when I use the created dll, I receive the following error:

Exception and stack trace:
System.InvalidProgramException: Common Language Runtime detected an invalid program.
at ASP.errorpage_aspx..ctor()
at __ASP.FastObjectFactory_app_web_pugar0lj.Create_ASP_errorpage_aspx()
at System.Web.Compilation.BuildResultCompiledType.CreateInstance()
at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp)
at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
at System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path)
at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


Solution:

  • Rename C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Team Tools\Performance Tools\vsinstr.exe to C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Team Tools\Performance Tools\vsinstr.exe.broken
  • Rename C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Team Tools\Performance Tools\vsinstr.legacy.exe to C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Team Tools\Performance Tools\vsinstr.exe
  • Rebuild the solution.

This worked for me hope this will work for you also.




ads 728x90 B
Powered by Blogger.