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
Visual Studio 2017 does not load .runsettings file. I attached the minimum sample that can work fine in Visual Studio 2013. The procedure is the followings:
Build
menu -> openConfiguration Manager
.Active solution configuration
toDebug(.NET 3.5)
.Test
menu ->Windows
-> openTest Explorer
.Test
menu again -> SelectTest Settings File
-> selectv3.5.runsettings
in the project.Test
menu again ->Default Processor Architecture
->x64
.Test
menu again -> uncheckKeep Test Execution Engine Running
.Test
menu ->Run
-> executeAll Tests
.=> All tests are failed. This is the problem.
The same procedure works fine in Visual Studio 2013. Also, the combination of
Active solution configuration
:Debug(.NET 4.6.2)
andv4.5.runsettings
works fine.