Avatar of ybt
ybt
 asked on

dotnet error

I use Angular CLI with Visual Studio Code
After auto system update my computer I was unable to start my server part of Angular application
 with "dotnet run", tried to use "dotnet restore" and got error:
error NU1100: Unable to resolve 'Microsoft.NET.Sdk ' for '.NETCoreApp,Version=v 2.2'.
How to resolve this?
Angular* DotNet.NET ProgrammingEditors IDEs

Avatar of undefined
Last Comment
ybt

8/22/2022 - Mon
Kelvin McDaniel

If you have Visual Studio 2017 and 2019 installed on the same machine you might not have the correct point release of .NET Core v2.2 for your application. Even if you don't have 2019 installed, you still might not have the release that you need.

.NET Core SDK v2.2.203  is for Visual Studio 2019. Even though it seems like it should work with your existing code, it does not work properly unless you have Visual Studio 2019 installed.

.NET Core SDK v2.2.106  Is the latest, stable release that works with supported earlier versions/configurations.

You can download both installers here.

If you find that you need to remove a particular version and/or SDK, follow the instructions here.
ybt

ASKER
I'm working with Visual Studio Code, this is not Visual Studio, is .NET Core SDK v2.2.106 preferable anyway?
Kelvin McDaniel

Absolutely, it is necessary unless you are *ONLY* using Visual Studio 2019.
Your help has saved me hundreds of hours of internet surfing.
fblack61
ybt

ASKER
I uninstalled .NET Core SDK v2.2.203 and now I have previous version .NET Core SDK v2.2.105
when I tried "dotnet run" got following error:
A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in
'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.2.4'.
ASKER CERTIFIED SOLUTION
Kelvin McDaniel

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ybt

ASKER
Thank You!