I have an InvalidProgram exception with the message

Common Language Runtime Detected an Invalid Program

This happen in an application that we didn't change in the last 3 month. The only change is that we have change our build server (reinstall it). The server is running Windows 8 and has Windows SDK 7.1 on it. We package the application with ClickOnce.

This exception happen in a very specific method call, after methods of the same class as assembly are already called, so I think it rules out assembly loading issues.

I can't find a lead to where to start debug this issue. I think it related to the version of the tools I use on the build server such as MSBuild, CSC, mage.exe and such.

I found people say this error might happen when I have very long method names, but this does not seem to apply here because I don't have long methods names and I don't generate code myself.

The application use .NET 4.0

Update 1 It is for sure a problem with the compile tools (the version I think) or the ClickOnce packaging tools because when I compile and run the application on my machine it work, when I install the packaged application on my machine it show the exception above.

有帮助吗?

解决方案

add this argument to your compiler: /nowin32manifest

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top