locked
Methods missing in mscorlib.4.0.0.0.Fakes.dll RRS feed

  • Question

  • I recently adopted a project that uses MS Fakes and I'm having trouble getting the unit test project to build. I'm using Visual Studio 2013 Premium Update 5.  I get the error:

    Error 31 'System.IO.Fakes.ShimDirectory' does not contain a definition for 'CreateDirectoryStringDirectorySecurity' C:\src\Einstein3\src\UnitTests\Shims\Dot Net\DirectoryShim.cs 25 27 UnitTests

    DirectoryShim.cs is our shim implementation and the error points to this line:

          ShimDirectory.CreateDirectoryStringDirectorySecurity = DirectoryShim.CreateDirectory;

    I used the Object Browser to look at System.IO.Directory in mscorlib and it has two entries for CreateDirectory; one that takes a string and one that takes a string and System.Security.AccessControl.DirectorySecurity.  The later is what is used in our code base.  However the generated mscorlib.4.0.0.0.Fakes.dll only contains one entry for CreateDirectory; only the one that takes a string is defined.  Why doesn't the fakes dll contain both?

    Can anyone explain why I don't have both in the fakes dll or how to get them both to appear?

    Thanks.

    Friday, December 4, 2015 6:20 PM

Answers

All replies

  • Hi trkmsa,

    >> I used the Object Browser to look at System.IO.Directory in mscorlib and it has two entries for CreateDirectory; one that takes a string and one that takes a string and System.Security.AccessControl.DirectorySecurity. 

    >>However the generated mscorlib.4.0.0.0.Fakes.dll only contains one entry for CreateDirectory;

    Could you share me two screen shots about the above results in your object browser? So I could check it in my side.

    Like this thread I met before, whether it is related to the real code like this thread?

    http://stackoverflow.com/questions/26241394/using-microsoft-fakes-i-get-a-compile-error

    Maybe you could share me a simple sample using one drive, I will debug it in my side using the same VS Environment as yours.

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, December 7, 2015 1:12 PM
  • Sure.  I tried to include them in the initial post but I got a "Body text cannot contain images or links until we are able to verify your account."  And I just got it again.  So hopefully this partial link will make enough sense to you.

    redir?resid=67390CE95EB99CC3!1845&authkey=!AF866MjZiPkNafc&ithint=folder%2cpng

    prefix the h t t p s : / / onedrive . live . com/

    Regards,

    Ty

    Monday, December 7, 2015 8:05 PM
  • Hi Ty,

    >>Body text cannot contain images or links until we are able to verify your account.

    You could resolve the account issue here:

    https://social.microsoft.com/Forums/en-US/f7e1de32-6b35-4926-b592-5b61d48e83c4/body-text-cannot-contain-images-or-links-until-we-are-able-to-verify-your-account?forum=reportabug

    Actually I couldn't visit the link provided by you, but it seems that I could repro this issue in my side.

    I test it in my VS2013 with update 5 and VS2015 with update 1, it has the "CreateDirectoryStringDirectorySecurity" in VS2015, but it really has a limitation in the VS2013.

    Since I could repro this issue, you can submit this feedback to Microsoft Connect feedback portal: http://connect.microsoft.com/VisualStudio/feedback/CreateFeedback.aspx,Microsoft engineers will evaluate them seriously. Thanks for your understanding.

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, December 8, 2015 8:10 AM