0

I installed Visual Studio 2012 Ultimate 30 days trial version. To get started with Microsoft Fakes I am following this tutorial . But when I added Fakes assembly for System.dll(In Unit test project .NET version 4/4.5/4.6 etc) It encountered into errors. Hence added workaround as per this post.

mscorlib.fakes xml filters:

<Fakes xmlns="http://schemas.microsoft.com/fakes/2011/">
  <Assembly Name="mscorlib" Version="4.0.0.0"/>
  <StubGeneration>
    <Clear/>
    <Remove FullName="System.Diagnostics.Tracing!"/>
    <Remove FullName="System.Text.Encoding!"/>
    <Remove FullName="System.Security.Cryptography!" />
    <Remove FullName="System.Security.Cryptography.Certificates!" />
  </StubGeneration>
  <ShimGeneration>
    <Clear />
    <Add FullName="System.DateTime!" />
  </ShimGeneration>
</Fakes>

The errors are resolved, but now it is giving me error

The name 'ShimDateTime' does not exist in the current context.

  • Can you please tell me why this error? And how to resolve it?

FYI: As stated into this post, errors are resolved into VS 2015 Enterprise edition.

  • That means do I need to purchase VS 2015 Enterprise Edition(Or higher)?
Community
  • 1
  • 1
GMCS Pune
  • 83
  • 1
  • 14
  • This https://msdn.microsoft.com/en-us/library/hh549175.aspx?f=255&MSPPError=-2147217396 seems to suggest that it only available in the Enterprise version of Visual Studio (see the Requirements section). – Bradley Uffner Feb 08 '17 at 15:31
  • **@Bradley** You can select other VS versions and can check Requirements section. In VS 2012 Ultimate Or Premium Fakes is available. – GMCS Pune Feb 09 '17 at 08:57
  • Where are you getting the error? From the compiler? Does intellisense recognize it? More of an aside, but why trial version of VS 2012 instead of '13 or '15? – doobop Feb 10 '17 at 05:27

1 Answers1

0

Microsoft fakes comes with visual studio licensed versions "see the link" . so all the features of it is available on "Visual Studio Enterprise" edition (even though some are there in other versions, all the functionalities want be of reach). recently I came across with the same issue with VS Ultimate 2013 and switching in to VS Enterprise edition 2015 solved my problem. editing "mscorlib.fakes" file wont do much use here.

Hope this isn't a late reply to this. Happy coding, cheers.

Tharusha
  • 635
  • 8
  • 25