Common Language Runtime detected an invalid program

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am developing an ASP.NET application on Visual Studio .NET 2003 (VB.NET
code). There are numerous forms, and a few user controls. Each form does
not have any more than 40 controls on it. It had been running fine in Debug
and Release modes (uploading to a test server every week) until this week
when...

....I was adding a new user control which is very simple, it uses a DataList
to show a list of items for a menu. There are a few public properties which
I set on each user control when placed on a webform. I managed to get this
up and running, and each page works beautifully.

I checked everything in to SourceSafe and was about to exit VS.NET when I
received the error "Common Language Runtime detected an invalid program".
After reading a bit on the Internet, I can say that I don't believe I have
too many controls on any one form. I attempted to run the application in
Release mode (remember, Debug worked just fine). When in Release mode, I get
"There were build errors. Continue?", and I select "No". The Tasks pane pops
up, but it is empty. I check the Output pane, and it says: "Error: Common
Language Runtime detected an invalid program." If I were to tell it "Yes"
when I get the build errors message, the application runs normally.

What can I do? I cannot find any errors in my new code.

Thanks in advance,
Andrew Puente
 
Also, I just ran PEVerify on the DLL file in the BIN directory of the ASP.NET
web application. It came back with "All Classes and Methods in <myfile>.dll
Verified".

I am not sure what more to do...

Thanks,
Andrew Puente
 
I found the solution to the problem on my own. I have been the only
developer working on the project this week (we work in a semi-isolated
development environment). I didn't want any other developers refreshing
their solution from the Source server, so I tried refreshing on a PC not
being used by any developer.

I then ran the project on this unused machine in Release mode, and it
compiled, but stopped because it did not know where to publish reports in the
SQL Reporting Services project that was also in the solution. [The solution
contains a Web project, a Database project, and a SQL Reporting Services
project]

I went back to my machine, which had the "CLR detected an invalid program"
problem, and attempted to get the TargetServer for the Reporting Services
project. When I right-clicked on the Reporting Services project, I got the
CLR error.

So, I end-tasked my Visual Studio .NET, fired it back up, went into the
solution, was able to set the TargetServer on the Reporting Services project,
and then compiled without any errors in Release mode.

Thank goodness... hope this helps someone someday. Anyone have a technical
explanation for what could have happened on my machine?

-Andrew Puente
 
Back
Top