paulius_l
paulius_l

Reputation: 4993

nunit.exe crashes with ConfigurationErrorsException

I have installed the current newest NUnit version from http://nunit.org/ (2.6.0.12051).

When I try running nunit.exe file, I get the ConfigurationErrorsException with a message saying: "Configuration system failed to initialize". It also contains an InnerException with a message "Unrecognized configuration section startup. (C:\Program Files (x86)\NUnit 2.6\bin\nunit.exe.Config line 10)".

If I launch nunit-86.exe, it works although it uses exactly the same config file.

I compared the Machine.config on my machine with Machine.config from the clean virtual machine and they are identical. Also, nunit.exe works on the clean VM, therefore something might be wrong with my development machine.

.NET 4 is installed on my machine. It runs Windows 7 x64.

How could this be fixed? What might be the causes for such behavior?

Upvotes: 1

Views: 1383

Answers (2)

8DH
8DH

Reputation: 2113

You could try this tool that verifies your .net framework installation: http://blogs.msdn.com/b/astebner/archive/2008/10/13/8999004.aspx

Update: I just had this problem on my machine and running the tool and checking the error log it revealed that my 2.0 installation was missing my machine.config. Strange but it solved the problem.

Upvotes: 1

paulius_l
paulius_l

Reputation: 4993

I hope this can help for other people facing the same problem. This is not a solution but rather a workaround I have come up with.

nunit.exe.config file contains the tags:

<startup useLegacyV2RuntimeActivationPolicy="true">
  <!-- Comment out the next line to force use of .NET 4.0 -->
  <supportedRuntime version="v2.0.50727" />
  <supportedRuntime version="v4.0.30319" />
</startup>

I did what the comment says - commented out the .NET v2.0 line and the process now loads on different runtime and everything works.

I do not know the answer why .NET 2.0 does not work but it is not the first time I have had this problem (Fiddler and Windows Azure emulator would have this problem also).

I hope somebody could explain the reasons why .NET 2.0 does not work or how it could be repaired.

Upvotes: 2

Related Questions