4

I have this error repeating continuously in my program.

I have tried the following:

  1. Restart Visual Studio
  2. Clean and Rebuild Solution

When I step through the code line by line, it stops leaving me totally confused at a method call:

GenerateWorksheetPart1Content(WorksheetPart worksheetPart1)

I don't understand why it stops there. The parameter is not null at the point. What could be causing the error?

Chibueze Opata
  • 9,856
  • 7
  • 42
  • 65

2 Answers2

4

MSDN - InvalidProgramException

Excerpt:

The exception that is thrown when a program contains invalid Microsoft intermediate language (MSIL) or metadata. Generally this indicates a bug in the compiler that generated the program.

This is happening as you step through the code because as your method is called it is being JIT compiled. If the compilation by the JITer is invalid, this exception will be thrown at this point.

Simon Whitehead
  • 63,300
  • 9
  • 114
  • 138
  • Is it just me or do I get this error frequently when dealing with VB.NET code rather than C#? To me it looks like the VB.NET JIT is trashy... also needs really long to change a single line. – Ray Jan 26 '15 at 14:16
0

Try following-

1) Delete temporary asp.net files from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
2) Recompile the assemblies and update the corresponding referenses

Microsoft DN
  • 9,706
  • 10
  • 51
  • 71
  • That folder doesn't exist on my machine. The only folders at that location are "CONFIG" and "en" and anyway, I'm running ASP.NET Core 2.2 – Iofacture Apr 15 '19 at 00:01