Bug Report: Unit Test Runner doesn't set TargetFramework for quirks mode

As explained at http://blogs.msdn.com/b/dotnet/archive/2012/10/17/net-framework-4-5-off-to-a-great-start.aspx, if you run a .NET app on the 4.5 runtime but the project targets 4.0, you'll get a 'quirks mode' for back-compat.When use Visual Studio's unit test runner, the quirks mode gets set correctly based on the unit-test project's target framework. However, when I use Resharper's test runner, quirks mode is always enabled.Resharper should set the target framework when creating the test AppDomain: http://msdn.microsoft.com/en-us/library/system.appdomainsetup.targetframeworkname(v=vs.110).aspxHere's a repro; it passes under Visual Studio test runner when targeting 4.0 or 4.5, but fails on Resharper when targeting 4.5:        [TestMethod]        public void TestMethod1()        {            bool quirksAreEnabled = Uri.EscapeDataString("'") == "'";            string targetFramework =                Assembly.GetExecutingAssembly()                    .GetCustomAttributes(typeof (TargetFrameworkAttribute), true)                    .Cast<TargetFrameworkAttribute>()                    .Single()                    .FrameworkName;            Assert.AreEqual(quirksAreEnabled, !targetFramework.Contains("4.5"));        }I'm running VS 11.0.61030 (Update 4), .NET 4.5.50709, and ReSharper
1 comment
Comment actions Permalink

Thanks for the bug report. I've added it to our YouTrack issue tracker: http://youtrack.jetbrains.com/issue/RSRP-412080

You can log on and track the issue simply by voting for it.



Please sign in to leave a comment.