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
@KathleenDollard In #3115, the SDK project chose to deprecate DotNetCliToolReference for good reason. However, .NET Local Tools have some limitations that become obvious when certain Microsoft DotNetCliToolReference projects haven't been kept up to date OOB with respect to major .NET versions.
Ex: Microsoft.Web.Xdt is a tool you can install in a TFM net48 Microsoft.NET.Sdk project, via DotNetCliToolReference. Installing that same tool locally currently causes the SDK tooling to choose the default framework, which is .NET 5.0. It then fails to install the tool, with a confusing error message.
Steps to Reproduce
Attempt to use -v d for detailed verbosity to understand why Microsoft.Web.Xdt can't be installed
I have elided most of the verbose logging, and focused mostly on the part I think causes the issue.
dotnet.exetoolinstall-vd--localMicrosoft.Web.Xdt
Error message below. Note the lines that say:
Checking compatibility for Microsoft.Web.Xdt 3.1.0 with net5.0 (any).
1>D:\Users\John.Zabroski\AppData\Local\Temp\1\su2bgq0d.svv\restore.csproj : error NU1212: Invalid project-package combination for Microsoft.Web.Xdt 3.1.0. DotnetToolReference project style can only contain references of the DotnetTool type
Incompatible packages: 1
Using "RestoreTask" task from assembly "C:\Program Files\dotnet\sdk\5.0.203\NuGet.Build.Tasks.dll".
Task "RestoreTask"
(in) RestoreGraphItems Count '4'
(in) RestoreDisableParallel 'False'
(in) RestoreNoCache 'False'
(in) RestoreIgnoreFailedSources 'False'
(in) RestoreRecursive 'True'
(in) RestoreForce 'False'
(in) HideWarningsAndErrors 'False'
(in) RestoreForceEvaluate 'False'
(in) RestorePackagesConfig 'False'
Running restore with 8 concurrent jobs.
Reading project file D:\Users\John.Zabroski\AppData\Local\Temp\1\su2bgq0d.svv\restore.csproj.
Restoring packages for D:\Users\John.Zabroski\AppData\Local\Temp\1\su2bgq0d.svv\restore.csproj...
Restoring packages for .NETCoreApp,Version=v5.0...
GET http://packages.simmaculate.com/nuget/Development/FindPackagesById()?id='microsoft.web.xdt'&semVerLevel=2.0.0
GET https://api.nuget.org/v3-flatcontainer/microsoft.web.xdt/index.json
OK http://packages.simmaculate.com/nuget/Development/FindPackagesById()?id='microsoft.web.xdt'&semVerLevel=2.0.0 194ms
OK https://api.nuget.org/v3-flatcontainer/microsoft.web.xdt/index.json 74ms
Resolving conflicts for net5.0...
Scanning packages for runtime.json files...
Restoring packages for net5.0/any...
Resolving conflicts for net5.0/any...
Skipping compatibility checks of the ridless graph for DotnetToolReference project type. This graph is not used.
Checking compatibility of packages on net5.0 (any).
Checking compatibility for restore 1.0.0 with net5.0 (any).
Checking compatibility for Microsoft.Web.Xdt 3.1.0 with net5.0 (any).
1>D:\Users\John.Zabroski\AppData\Local\Temp\1\su2bgq0d.svv\restore.csproj : error NU1212: Invalid project-package combination for Microsoft.Web.Xdt 3.1.0. DotnetToolReference project style can only contain references of the DotnetTool type
Incompatible packages: 1
Committing restore...
Writing assets file to disk. Path: D:\Users\John.Zabroski\AppData\Local\Temp\1\pz32g0mb.0hn\project.assets.json
Failed to restore D:\Users\John.Zabroski\AppData\Local\Temp\1\su2bgq0d.svv\restore.csproj (in 506 ms).
NuGet Config files used:
D:\Users\John.Zabroski\AppData\Roaming\NuGet\NuGet.Config
C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config
Feeds used:
https://api.nuget.org/v3/index.json
http://packages.simmaculate.com/nuget/Development/
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
Done executing task "RestoreTask" -- FAILED.
1>Done building target "Restore" in project "restore.csproj" -- FAILED.
1>Done Building Project "D:\Users\John.Zabroski\AppData\Local\Temp\1\su2bgq0d.svv\restore.csproj" (Restore target(s)) -- FAILED.
Build FAILED.
Attempt to specify framework to override the default of .NET 5.0
The local option(--local) does not support the framework option (--framework).
Workarounds
I don't see any, in particular, immediately available.
One idea is that Microsoft should publish Microsoft.Web.Xdt out-of-box for .NET 5.0. I don't understand why they stopped publishing it after .NET Core 3.0.
The text was updated successfully, but these errors were encountered:
Someone at Microsoft pointed out that Microsoft.Web.Xdt is not a CLI tool. I was switching back and forth between this library and https://www.nuget.org/packages/Microsoft.DotNet.Xdt.Tools/ - from there, I was able to deduce the root cause is the packageType is not Tool on this package. I will have to see if that fixes the problem, and then re-submit.
Problem statement
@KathleenDollard In #3115, the SDK project chose to deprecate DotNetCliToolReference for good reason. However, .NET Local Tools have some limitations that become obvious when certain Microsoft DotNetCliToolReference projects haven't been kept up to date OOB with respect to major .NET versions.
Ex: Microsoft.Web.Xdt is a tool you can install in a TFM net48 Microsoft.NET.Sdk project, via DotNetCliToolReference. Installing that same tool locally currently causes the SDK tooling to choose the default framework, which is .NET 5.0. It then fails to install the tool, with a confusing error message.
Steps to Reproduce
Attempt to use -v d for detailed verbosity to understand why Microsoft.Web.Xdt can't be installed
I have elided most of the verbose logging, and focused mostly on the part I think causes the issue.
Error message below. Note the lines that say:
Attempt to specify framework to override the default of .NET 5.0
Error message:
Workarounds
I don't see any, in particular, immediately available.
One idea is that Microsoft should publish Microsoft.Web.Xdt out-of-box for .NET 5.0. I don't understand why they stopped publishing it after .NET Core 3.0.
The text was updated successfully, but these errors were encountered: