I am trying to implement xUnit for testing C #, but am in a weird error.
I can run unit tests in VisualStudio (2013), but when I try to run the same tests using the GUI or the console, I get an error message:
xUnit.net console test runner (32-bit .NET 2.0.50727.5472)
Copyright (C) 2013 Outercurve Foundation.
Could not load file or assembly '[...]' or one of its dependencies.
This assembly is built by a runtime newer than the currently loaded
runtime and cannot be loaded.
My project uses .net 4.0 and appears xUnit uses 2.0.
I found a couple of posts here and here , among other things, saying that you can edit the configuration file, but that did not work for me. Both of these posts are a couple of years old and they do not even agree with each other. One says the entry should be "supportedRuntime" and the other should be "requiredRuntime". However, none of them work for me.
I also thought about downloading the source code and compiling it using 4.0, but according to the website it needs VS 2010.
Running tests in the IDE is great, but I also need to use the console to run automated tests on our build machine. Is there any way to make this work? Or is xUnit no longer supported?
I also found another post where the problem was allegedly fixed in 2010. Maybe this is a rejection of regression?
source
share