Just installed vs 2012 update 2 (http://www.microsoft.com/en-us/download/details.aspx?id=36833) so I can use vs fakes/shims to test some hard to test code. Everything compiles just fine when I create the fake assemblies and all references are added within the unit test project as expected. However running the following code in any test...
using (ShimsContext.Create())
{
//Doesn't matter whats in here
}
Throws the following exception...
Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationException : UnitTestIsolation instrumentation failed to initialize. Please restart Visual Studio and rerun this test
Full exception with stack trace...
Test 'Abot.Tests.Unit.Core.HapHyperLinkParserTest.HyperLinkParserTest.GetLinks_AreaTags_ReturnsLinks' failed: Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationException : UnitTestIsolation instrumentation failed to initialize. Please restart Visual Studio and rerun this test
at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationRuntime.InitializeUnitTestIsolationInstrumentationProvider()
at Microsoft.QualityTools.Testing.Fakes.Shims.ShimRuntime.CreateContext()
at Microsoft.QualityTools.Testing.Fakes.ShimsContext.Create()
CoreHyperlinkParserTest.cs(59,0): at Abot.Tests.Unit.Core.HyperLinkParserTest.GetLinks_AreaTags_ReturnsLinks()
A few notes...
- I'm using visual studio 2012 premium
- All projects in the solution target .net 4.0
- I'm using nunit for the testing framework
- Tried running tests through testdriven.net plugin and nunit gui but same error.
- Tried targeting .net 4.5 and got the same error
- I'm NOT using Typemock or Ncrunch and they are not installed
- I am using Moq but removed it from the th
- Its not tied to a specific test, i've verified it fails in different test files and in another solution as well.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…