Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.IO.File in .NET Standard library fails when run in unit test #363

Closed
davkean opened this issue Jan 20, 2017 · 8 comments
Closed

System.IO.File in .NET Standard library fails when run in unit test #363

davkean opened this issue Jan 20, 2017 · 8 comments
Assignees

Comments

@davkean
Copy link
Member

davkean commented Jan 20, 2017

From @gulbanana on December 16, 2016 11:28

Possibly this issue should be in a vstest repository but I can't find one.
Repro: https://github.com/gulbanana/repro-netstandard-systemio

When using System.IO in a .NET Standard 1.4 class library, unit tests referencing the library fail. The error is
Message: System.IO.FileLoadException : Could not load file or assembly 'System.IO.FileSystem, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Copied from original issue: dotnet/project-system#975

@davkean
Copy link
Member Author

davkean commented Jan 20, 2017

From @srivatsn on December 16, 2016 20:31

@codito

@davkean
Copy link
Member Author

davkean commented Jan 20, 2017

From @srivatsn on December 20, 2016 22:57

@dotnet/vstest

@davkean
Copy link
Member Author

davkean commented Jan 20, 2017

From @codito on December 21, 2016 12:50

We're investigating this issue. As a workaround, please use <PackageReference Include="NETStandard.Library" Version="1.6.0" /> instead of 1.6.1 in netstdlib.csproj.

@davkean
Copy link
Member Author

davkean commented Jan 20, 2017

From @gulbanana on December 21, 2016 13:47

I've verified that the workaround works on my system (until I want to use a nuget package which references 1.6.1 :-) )

@smadala
Copy link
Contributor

smadala commented Feb 20, 2017

There is mismatch between version number of .nuget\packages\system.io.filesystem\4.3.0\ref\netstandard1.3\System.IO.FileSystem.dll (4.0.1) and .nuget\packages\system.io.filesystem\4.3.0\lib\net46\System.IO.FileSystem.dll(4.0.2).
There is no .nuget\packages\system.io.filesystem\4.3.0\lib\netstandard1.3\System.IO.FileSystem.dll file.

Due this mismatch System.IO.FileSystem 4.0.1 getting bind in compile time. which is not found in runtime.

This issue can be repro with simple console app referring netstdlib.

Sln with console app - repro-netstandard-systemio.zip

@codito
Copy link
Contributor

codito commented Feb 20, 2017

@smadala packaging issue in corefx?

@smadala
Copy link
Contributor

smadala commented Feb 20, 2017

Could be, moving to corefx.

@smadala
Copy link
Contributor

smadala commented Feb 20, 2017

This issue was moved to dotnet/corefx#16322

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants