Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Common Language Runtime detected an invalid program in Visual Studio

I have been using Visual Studio 2008 quite long but lately I am getting this message when I am developing an application in C#:

Common language runtime detected an invalid program

This happens when I try to enter to the properties of a component (text masked box properties, tool box property etc..). But it really became a problem when I tried to launch an other solution that I downloaded from the Developer's 5 star program of Microsoft and it didn't allowed me to launch at all and just got the same problem...

I looked for the answer at google but just got some clues about people having the same vague error but in different situations like in ASP.NET

I would appreciate any help with this issue... :( I do not want to reinstall VS, that will be my last resource...

Update:

I never figured out what the problem was so I installed a virtual machine with Windows XP on it, there I only have Visual Studio and Netbeans.

like image 742
Jimmy Avatar asked Oct 30 '09 22:10

Jimmy


3 Answers

I had the same problem after we installed AppDynamics. The solution was to uninstall AppDynamcis.

We are using .NET remoting, to call are web services. (Legacy project)

like image 194
Preben Huybrechts Avatar answered Sep 25 '22 14:09

Preben Huybrechts


I faced this issue by trying to invoke System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace() For this case the solution was to edit the project file and make sure the reference to related asembly looks exactly so:

<Reference Include="System.Management.Automation" />

Other ways to reference this assembly, via the VS 2012 asseblies picker and by picking the assembly into the physical location of reference assembly.

like image 9
Konstantin Isaev Avatar answered Oct 06 '22 09:10

Konstantin Isaev


Can you reproduce the problem in a new solution without referencing any extra assemblies? If so, I think reinstalling would be your best bet. Sorry!

like image 5
GraemeF Avatar answered Oct 06 '22 10:10

GraemeF