Friday, July 1, 2011

CLR version error on starting Nunit

I am totally new to Nunit and creating test cases in VS for it, so I google for tutorial, follow the steps word by word try to pull the project in NUnit and am received by a lovely window


Makes me feel either I am too dumb or Nunit needs to test their own product (least they could do is have some user friendly message and direct to proper documentation)

But things are not meant to be simple in ITville so I call upon my dear friend Google to help me out again and found a solution for how to fix it here

Just copying over the solution for ease of reference:
Open the nunit-x86.exe.config file (My file is at C:\Program Files (x86)\NUnit 2.5.10\bin\net-2.0)
Under <configuration> add:
<startup> 
     <supportedRuntime version="v4.0.30319" /> 
</startup>

and under <runtime> add:
<loadFromRemoteSources enabled="true" />

NOTE: It is always a good idea to leave the original setup files untouched (just in case you screw up something). Normally I rename the original file by adding a .ORIG extension, make its copy and then do any changes that I want.

If you still happen to get the same error every time you open NUnit, then delete all the shortcuts for NUnit and create a new one from the .exe in the bin folder again.

Credits: http://stackoverflow.com/questions/930438/nunit-isnt-running-visual-studio-2010-code

No comments:

Post a Comment