Created new project with dotnet new console
This is the response
C:\Users\favishg\Documents\testdotnet>dotnet new console
Getting ready...
The template "Console Application" was created successfully.
Processing post-creation actions...
Running 'dotnet restore' on C:\Users\favishg\Documents\testdotnet\testdotnet.csp
roj...
C:\Users\favishg\Documents\testdotnet\testdotnet.csproj : error MSB4236: The SDK
'Microsoft.NET.Sdk' specified could not be found.
Restore failed.
Post action failed.
Description: Restore NuGet packages required by this project.
Manual instructions: Run 'dotnet restore'
C:\Users\favishg\Documents\testdotnet>dotnet restore
C:\Users\favishg\Documents\testdotnet\testdotnet.csproj : error MSB4236: The SDK
'Microsoft.NET.Sdk' specified could not be found.
I have the latest SDK (2.1.301) installed, and visual studio 15.7.3 installed.
After playing around a while i see that the issue only happens when i'm not logged in as an Admin user, But if logged in as admin or running the cmd as Admin it works good.
I'm running into a similar issue. If I run dotnet restore on my build server running as system the command fails with error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.
If I run as interactive administrator, I get no error.
I'm able to reproduce the error by running the service as Administrator
did one of you have a previous .net sdk version installed? so, does it work with a 2.1.2xx CLI and it breaks using 2.1.3xx?
Did have older versions installed, but never really used the CLI, i used Visual Studio, and from visual studio it still works with this version, only the CI has this issue.
@livarcocc do you maybe have an idea about this?
Do 2.1.3xx have the resolver changes (where msbuild uses a manifest to locate SDK resolvers)?
My issue was due to the environment variable MSBuildSDKsPath getting set as part of the build process. Once that was removed, I'm no longer having any problems.
Most helpful comment
After playing around a while i see that the issue only happens when i'm not logged in as an Admin user, But if logged in as admin or running the cmd as Admin it works good.