Questions tagged [invalidprogramexception]

An exception running a .NET program, usually caused by a faulty compiler.

An exception when running a .NET program, usually caused by a faulty compiler.

19 questions
7
votes
0 answers

InvalidProgramException with shims in Visual Studio 2015

An almost similar question has already been asked a while ago but not answered yet. And since my setup is a little different, I start a new try: I demonstrate a shortened version of my code, but even this short version produces the error. I have a…
5
votes
1 answer

Why does localloc break this CIL method?

I have the following piece of reduced CIL code. When this CIL method is executed, an InvalidProgramException is being thrown by the CLR: .method assembly hidebysig specialname rtspecialname instance void .ctor(class…
valiano
  • 16,433
  • 7
  • 64
  • 79
4
votes
3 answers

"Common Language Runtime detected an invalid program" on Azure Web Role with Castle Windsor

I have a web role that works perfectly on my Development PC (VS2013 & Window 8.1 Enterprise x64), but fails when I publish it to Azure with the following exception: [InvalidProgramException: Common Language Runtime detected an invalid program.] …
Ben
  • 193
  • 8
2
votes
4 answers

CLR detected an invalid program with Entity Framework

I am retrieving data from a wordpress database which defines the primary key as decimal and I am using a x64 configuration on the project... The bit I searched I found out that it is the problem, but I couldn't find a solution. What do I have to…
BrunoLM
  • 97,872
  • 84
  • 296
  • 452
2
votes
1 answer

C# ASP.NET "InvalidProgramException: Common Language Runtime detected an invalid program"

I'm getting the above exception trying to 'start with debugging' an ASP.NET MVC Web Application using .NET 4.5 and targeting 'Any CPU'. All other questions I've found regarding this issue seem to know exactly where in the application is causing the…
1
vote
0 answers

Xamarin: InitializeComponent () is too complex

I am currently developing an App for IOS and Android with Xamarin Forms. I am debugging with my Android device. Starting yesterday, when trying to build and test my solution, it falls into a break state before the App is even loaded. The exception…
user2669261
  • 396
  • 1
  • 5
  • 18
1
vote
0 answers

InvalidProgramException: identify faulty instruction

I generate assemblies dynamically and invoke methods from those assemblies. I use both visual studio and mono. Sometimes, I do something wrong with ILGenerator.Emit, and get an InvalidProgramException when trying to invoke a method. Is there any…
Regis Portalez
  • 4,675
  • 1
  • 29
  • 41
1
vote
1 answer

Program crashes when calling a function from Main

This is probably some rookie mistake but I can't find it. ilasm says that my code generates System.InvalidProgramException. I discovered that it is thrown the moment I invoke Fibonacci() - a flag put before calling it is written to the console but…
matt-pielat
  • 1,659
  • 3
  • 20
  • 33
1
vote
0 answers

Invalid IL code in System.Drawing.ColorConverter:.ctor (): method body is empty

I am Japanese developer,so English is a strange sorry. I am deploying an asp.net web project to a Mono linux box. I had the skeleton working pretty nice, but when I started Building in , I got the error you see above. I've set the dll to copy local…
Com Mk
  • 11
  • 1
0
votes
2 answers

.NET Compact Framework Reflection call to internal method in .NET framework class

I am trying to load a .NET assembly from a .NET 2.0 CF application. I want to invoke an internal method with three params like so: var obj = new System.Web.Security.SqlMembershipProvider(); MethodInfo mi = obj.GetType().GetMethod("GenerateSalt", …
0
votes
0 answers

Creating RunTime Mock: InvalidProgramException after compiling Expression.Throw with Expression.Throw

I am trying to create a run-time mock, which will have a specific behaviour for every method, which will be called. For example this mock should always return null - which is already working - or raise an exception for a not reachable database or in…
chbest
  • 23
  • 4
0
votes
0 answers

invalidprogramexception cannot be captured by the try catch block

there, a piece of code is like this: try { ClassA a = new ClassA(); } catch(Exception e) { ...... } that class A is in another assembly, however, in some environment, that assembly got corrupted, so I expect I will receive the…
cao lei
  • 891
  • 1
  • 9
  • 19
0
votes
1 answer

WCF Common Language Runtime detected an invalid program on windows XP

I have a windows forms application running on .NET 4 that communicates with a WCF web service. The application is compiled to run with X86 as the platform target. The application was deployed on a network of hundreds of computers, and there are only…
Leonardo
  • 13
  • 4
0
votes
1 answer

Invalid program exception in release build (.NET 4.6.1)

I have a program that deals with socket communication asynchronously. The exception I've been getting only occurs in release build (on build machines). The code that causes the problem is really simple routine to start listening for incoming socket…
void
  • 333
  • 4
  • 12
0
votes
0 answers

Getting InvalidProgramException on MSTest using vstest.console.exe

I'm getting this weird InvalidProgramException when trying to call a static method from a static class that's in an external assembly. I've already tried bringing the routine within the same assembly, but the result is the same. Any ideas?
Pedro Luz
  • 973
  • 5
  • 14
1
2