Open
Description
Overview
While looking at the sample projects I noticed some warnings/errors showed up on rebuild of SimpleNuGetDependency. The errors only show if the sample project is moved outside of the msb4u repo. The errors do not repeat on subsequent builds, nor do they prevent simulation in the Unity editor.
C:\Users\nimilsom\Desktop\SimpleNuGetDependency.Unity\Assets\NewtonsoftDependency> dotnet msbuild NewtonsoftDependency.csproj -restore -v:minimal -p:NuGetInteractive=true -t:Rebuild -p:Configuration=Release
C:\Users\nimilsom\Desktop\SimpleNuGetDependency.Unity\Assets\NewtonsoftDependency\NewtonsoftDependency.csproj : warning NU1604: Project dependency MSBuildForUnity does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results.
C:\Users\nimilsom\Desktop\SimpleNuGetDependency.Unity\Assets\NewtonsoftDependency\NewtonsoftDependency.csproj : warning NU1604: Project dependency MSBuildForUnity does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results.
C:\Users\nimilsom\.nuget\packages\msbuildforunity\0.1.115888\buildCommon\UnityMetaFileGenerator.targets(147,5): error : MSB4801: The task factory "CodeTaskFactory" is not supported on the .NET Core version of MSBuild. [C:\Users\nimilsom\Desktop\SimpleNuGetDependency.Unity\Assets\NewtonsoftDependency\NewtonsoftDependency.csproj]
C:\Users\nimilsom\.nuget\packages\msbuildforunity\0.1.115888\buildCommon\UnityMetaFileGenerator.targets(147,5): error MSB4175: The task factory "CodeTaskFactory" could not be loaded from the assembly "C:\Program Files\dotnet\sdk\3.1.100\Microsoft.Build.Tasks.Core.dll". The task factory must return a value for the "TaskType" property. [C:\Users\nimilsom\Desktop\SimpleNuGetDependency.Unity\Assets\NewtonsoftDependency\NewtonsoftDependency.csproj]
Here's a link to the full logs for these warnings/errors which include the callstack:
https://gist.github.com/MenelvagorMilsom/c68be7ae3581b9abccac7809b13f45fd
Repro Steps
- Use DownGit to download https://github.com/microsoft/MSBuildForUnity/tree/master/Samples/SimpleNuGetDependency.Unity.
- Alternatively, clone or download the full msb4u repo and copy the SimpleNuGetDependency sample to a new location outside of the repo.
- Modify
Packages\manifest.json
so that it uses the scoped registry for accessing the package.
"scopedRegistries": [
{
"name": "Microsoft",
"url": "https://pkgs.dev.azure.com/UnityDeveloperTools/MSBuildForUnity/_packaging/UnityDeveloperTools/npm/registry/",
"scopes": [
"com.microsoft"
]
}
],
"com.microsoft.msbuildforunity": "0.8.3"
- Open the Unity project and select Rebuild All Projects.
- Observe errors printed to the editor console.