5

I am trying to get my first .Net Core solution working.

When I try to create a project in VS 2015, it fails. So back to basics.

Using these directions: MS .Net Core

I did this.

C:\dev\Tests>mkdir hwapp2
C:\dev\Tests>cd hwapp2
C:\dev\Tests\hwapp2>dotnet -v new


Welcome to .NET Core!
---------------------
Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs.
Telemetry
--------------
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include commandline arguments. The data is collected by Microsoft and shared with the community.
You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell.
You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry.
Configuring...
-------------------
A command is running to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
Decompressing 100% 1758 ms
Expanding 100% 6072 ms
Failed to create prime the NuGet cache. restore failed with: 1
Telemetry is: Disabled
Created new C# project in C:\dev\Tests\hwapp2.

I am running this in a Command Prompt as an Admin. Same thing happens when I try to create a project in VS 2015. Did try with Firewall turned off by the way.

Environment is

  • Windows 10 Pro (Build 14393)
  • VS 2015 with Update 3 (Enterprise)
  • Dot Net Core Preview 2.0.1 (latest download as of Sept 10th 2016)
Tseng
  • 61,549
  • 15
  • 193
  • 205
Ben Levy
  • 129
  • 1
  • 9

4 Answers4

1

You should install the latest .NET Core SDK and remove all previously installed versions.

torpederos
  • 761
  • 12
  • 31
0

Try clear nuget cache like in this post. It was helped for me.

Briefly, you need to download nuget command line tool from here.

And then run command: nuget locals all -clear

AlBa231
  • 31
  • 6
0

This is a known issue.

I had to perform the following steps to fix this issue:

  • uninstall Microsoft .Net Core SDK 2.0 Preview 1
  • uninstall Microsoft .Net Core SDK 2.0 Preview 2

This allowed me to execute the command "dotnet run" without the error above.

After running "dotnet run" once I reinstalled Microsoft .Net Core SDK 2.0 Preview 2 again and the error didn't show up anymore (which is what should happen according to this post)

Marcel Studer
  • 581
  • 8
  • 9
0

An issue on GitHub describes the situation where dotnet-core 2.0.0 is installed but SDK 1.0.4 is defined in the global.json. The following environment variable is a workaround:

DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
Boggin
  • 3,251
  • 3
  • 33
  • 48