Building and running project for net462 runtime
See original GitHub issueIssue might be related to https://github.com/dotnet/sdk/issues/1488
There are several reproductions of the issue. The test package for the issue is cloudscribe.Web.Pagination
https://www.nuget.org/packages/cloudscribe.Web.Pagination/1.1.4, which is targeting netstandard1.6
only; startup project A
target is net462
as well as referenced project B
.
The issue might be due to screwed up package, wrong target (why if so?) but it’s not clear by error messages or behavior.
https://github.com/multiarc/SDKRepro/branches
global.json used to specify SDK version 1.1.8
build_fail
– not able to build.
Error messages is not clear what to do, all packages including framework assemblies appeared with warning mark.
MSB4062 The "NETBuildExtensionsError" task could not be loaded from the assembly C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\\tools\net46\Microsoft.NET.Build.Extensions.Tasks.dll. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. A C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.NETFramework.targets 65
Cannot find project info for 'C:\Docs\Work\SDKRepro\src\B\B.csproj'. This can indicate a missing project reference. A C:\Program Files\dotnet\sdk\1.1.8\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk.targets 92
run_fail
– able to build using <DependsOnNETStandard>netstandard1.6</DependsOnNETStandard>
, cannot start (System.Linq 4.1.0.0 assembly cannot load)
master
– completely fine project, builds and starts up no problem, just an example without package reference
global.json is removed
no_global_run_fail
– same as run_fail
no_global_another_run_fail
– magically able to build, cannot start due to Microsoft.CSharp assembly cannot load
SDK Versions
.NET Command Line Tools (2.1.101)
Product Information:
Version: 2.1.101
Commit SHA-1 hash: 6c22303bf0
Runtime Environment:
OS Name: Windows
OS Version: 10.0.16299
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.101\
Microsoft .NET Core Shared Framework Host
Version : 2.0.6
Build : 74b1c703813c8910df5b96f304b0f2b78cdf194d
.NET Command Line Tools (1.1.8)
Product Information:
Version: 1.1.8
Commit SHA-1 hash: 227be613d2
Runtime Environment:
OS Name: Windows
OS Version: 10.0.16299
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\1.1.8
Microsoft .NET Core Shared Framework Host
Version : 2.0.6
Build : 74b1c703813c8910df5b96f304b0f2b78cdf194d
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top GitHub Comments
OK, I’ve worked out what’s going on. Thanks a lot for the repro
build_fail
branchIt’s not supported to build this project with a 1.x SDK. You are supposed to get the following error message:
However, this is broken in VS 15.6, and you get the error that the
NETBuildExtensionsError
task can’t be loaded instead. I’ve filed #2061 for this.run_fail
andno_global_run_fail
branchesSetting the
DependsOnNETStandard
property tonetstandard1.6
is not supported. It (incidentally) has the same effect as setting this property to false, which disables build logic that is needed to make the project run correctly.no_global_another_run_fail
branchNow the only remaining is the original one that was reported in #1488. The workaround is to add a reference to a 2.0 version of the Microsoft.Extensions.DependencyModel package:
You could also update the app to use ASP.NET Core 2.0, though that would likely require more changes.
Closing as @dsplaisted seems to have addressed all the issues.