xUnit and .NET 4.0

Trying to run xUnit tests compiled against the 4.0 framework with the visual tool (xunit.gui.x86) I was welcomed by an error message telling me that the target .dll was compiled a more recent runtime than the one in use. After some googling I was able to find a fix for the console runner (xunit.console.x86), which consists in adding the following config section to the XML configuration file (xunit.console.x86.exe.config):

    <supportedRuntime version="v4.0.30319" />

(your .NET framework version may vary, take a look at your %systemroot%\Microsoft.NET\Framework for more info)

To make the fix work for the GUI runner you can just make a copy the modified console application’s configuration file and rename it as xunit.gui.x86.exe.config


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s