简体   繁体   中英

error NU1100: Unable to resolve 'Microsoft.AspNetCore.SpaServices.Extensions

I was trying to build a react app using Dotnet. I have installed dotnet but still getting this error. I have installed dotnet 5 and dotnet core 3.5. I have given the necessary images regarding the error.

First Image

Second Image

D:\\dotnet project\\Try\\Try.csproj : error NU1100: Unable to resolve 'Microsoft.AspNetCore.SpaServices.Extensions (>= 5.0.9)' for 'net5.0'.

Try installing the version 5.0.1, Link . I faced the same issue a while back and it was fixed by installing a lower version. If it doesn't work, then try installing version 4.8

Between older version of .NET 5.0 there has been an rename of the targetFramework.
.net 5.0 vs netcoreapp5.0 Github

If your nuget package version doesn't contain your target framework,
please update or align the targetframework in your csproj file
with the contents of the nuget package or choose a more recent package.

Now it should be net5.0

Oddly for my project, the user's computer couldn't find restorable packages because it didn't have a mapping for (the real) nuget. We had to add (or run from powershell):

dotnet nuget add source --name nuget.org https://api.nuget.org/v3/index.json

Then nuget restore worked and the error went away.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM