You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
execute reproduce.sh or reproduce.ps1 to use an isolated copy of dotnet core 1.1, or simply do:
dotnet restore
dotnet test
in each project under the test folder. One will work, one will not. The only difference between the two is a different version of the same dependency. The one that fails is actually the current production version of the dependency.
The text was updated successfully, but these errors were encountered:
I can't get your reproduce.ps1 to run without errors (it fails at the very beginning when it tries to download .NET Core or something), so I just looked at the actual test code and ran below program with the following NuGet package dependencies. It ran successfully.
Microsoft.NETCore.App 1.1.2
Microsoft.Build.Framework 15.1.1012 (I also tried version 15.1.262-preview5)
Moq 4.7.25 (I also tried version 4.6.38-alpha)
using Microsoft.Build.Framework;using Moq;classProgram{staticvoidMain(){
Mock.Of<IBuildEngine>();
Mock.Of<IBuildEngine4>();}}
Could you please update your repro code to current versions of .NET Core, Microsoft.Build.Framework, and Moq, and see if the error persists?
Having a look at this again. I believe the error you encountered might be due to the way how Microsoft.Build.Framework version 14.3.0 is made up.
According to the package page on NuGet.org, this package does target .NET Standard 1.3 (since the page lists dependencies for that target). If you download and extract the package, you will see the following contents:
Note the absence of a lib\netstandard1.3 folder with the actual assembly. (This would be the relevant one, as net45 should be unusable on the .NET Core platform.) The assembly under ref\netstandard1.3 appears to be a reference assembly; it does not contain any working implementations, and it will not get copied to your program's output directory. Therefore, I would assume that if you do not have version 14.3.0 of Microsoft.Build.Framework installed system-wide, you're going to get the FileNotFoundException.
Contrast this with Microsoft.Build.Framework version 15.1.262-preview5. This package does contain the assembly for the relevant platform:
I created a simple reproduction in a repo: https://github.com/dmccaffery/moq-repro
execute reproduce.sh or reproduce.ps1 to use an isolated copy of dotnet core 1.1, or simply do:
in each project under the test folder. One will work, one will not. The only difference between the two is a different version of the same dependency. The one that fails is actually the current production version of the dependency.
The text was updated successfully, but these errors were encountered: