Created
April 29, 2017 00:39
-
-
Save urasandesu/0c76233771de2cdc0c8027b1a8441e4a to your computer and use it in GitHub Desktop.
Visual Studio 2017 does not load .runsettings file. The following sample works fine in Visual Studio 2013.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using NUnit.Framework; | |
using System.Diagnostics; | |
namespace RunSettings2017 | |
{ | |
[TestFixture] | |
public class Class1 | |
{ | |
[Test] | |
public void ProcessNameTest() | |
{ | |
#if _NET_3_5 | |
Assert.AreEqual("vstest.executionengine.clr20", Process.GetCurrentProcess().ProcessName); | |
#elif _NET_4_5 | |
Assert.AreEqual("vstest.executionengine", Process.GetCurrentProcess().ProcessName); | |
#endif | |
} | |
[Test] | |
public void ImageRuntimeVersionTest() | |
{ | |
#if _NET_3_5 | |
Assert.AreEqual("v2.0.50727", typeof(object).Assembly.ImageRuntimeVersion); | |
#elif _NET_4_5 | |
Assert.AreEqual("v4.0.30319", typeof(object).Assembly.ImageRuntimeVersion); | |
#endif | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<RunSettings> | |
<RunConfiguration> | |
<TargetFrameworkVersion>Framework35</TargetFrameworkVersion> | |
</RunConfiguration> | |
</RunSettings> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<RunSettings> | |
<RunConfiguration> | |
<TargetFrameworkVersion>Framework45</TargetFrameworkVersion> | |
</RunConfiguration> | |
</RunSettings> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How about framework 4.6, 4.7?