Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
419 views
in Technique[技术] by (71.8m points)

.net - 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...