Basic bproject create Failed to create prime the Nuget cache - asp.net-core

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)

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

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

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)

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

Related

Getting error "No templates matched the input template name: blazorwasm."

I'm trying to create a new .net core Blazor WebAssembly App with VS 2019 following this but so far I have had no luck.
As indicated in these docs, I've downloaded the latest preview VS 2019 Professional and typed this on a command window:
dotnet new blazorwasm --hosted
But I keep getting the following error:
No templates matched the input template name: blazorwasm.
This Blazor webAssembly feature is on preview -- it was only released very recently -- and hence understandably prone to errors, but still MS documentation normally is quite accurate, so I'm surprised this is not working as per their explanation.
I would appreciate any help with this.
As mentioned in the comment please install
dotnet new -i Microsoft.AspNetCore.Blazor.Templates::3.0.0-preview9.19424.4
Reference
You need .NET SDK 3.1.300 [C:\Program Files\dotnet\sdk] to use dotnet new blazorwasm --hosted. You can view your installed version by running dotnet --info.
To update, eather download from: https://dotnet.microsoft.com/download/visual-studio-sdks
Or update vistual studio to version 16.6 or greater.

How can I install a newer MSBuild version?

I am trying to build Microsoft.AspnetCore.Identity from sources. The instructions are here: https://github.com/dotnet/aspnetcore/blob/master/docs/BuildFromSource.md. I am trying to run their command "restore.cmd" and hitting the following error:
error : Version 3.1.10 2 of the .NET Core SDK requires at least version 16.3.0 of MSBuild. The current available version of MSBuild is 16.0.46
1.62831. Change the .NET Core SDK specified in global.json to an older version that requires the MSBuild version currently available.
The error message's suggestion of changing the .Net Core SDK version seems absurd. Surely the solution is to install MSBuild 16.3.0. But how do I do that?
As an aside which may or may not be relevant, the instructions also have a script for installing the "exact required" version of VS. But it seems to install a new one that goes side-by-side with my existing version. Their "startvs" command then starts the existing one, rather than the new one. It has to be better to add everything needed to the existing installation. But I'm missing how to add MSBuild 16.3.0.
The error message's suggestion of changing the .Net Core SDK version
seems absurd. Surely the solution is to install MSBuild 16.3.0. But
how do I do that?
1) Please make sure that you have run ./eng/scripts/InstallVisualStudio.ps1 to install the required tools.
2) If you have VS2019, try to enable the option Use previews of the .NET Core SDK(require restart) under Tools--> Options-->Environment-->Preview Features.
a) If you have VS2019 at your agent, just update it to the latest version so that you will get the latest version about MSBuild.
b) Download the latest version of Build Tool for VS2019. You can download it under Tools for Visual Studio 2019 from this link. If you have already downloaded it, please update it to the latest version in vs installer. Also, make sure that you have install the workload Net Core build tools. After that, you can build net core projects with it.
3) Then try to run .\restore.cmd in developer command prompt.

DNX SDK version "dnx-clr-win-x86.1.0.0-preview2-003131" failed to install

I am not understanding why am I getting above mentioned error while loading some new pulled project from tfs. Even though I have Microsoft DNX folder in my explorer it asks me to install DNX SDK and when I install it fails.
I tried updating visual studio also but it didn't work.
Can anyone help me with this?
Since I use VS 2015, above mentioned issue resolved for me by downloading specific .Net Core version from https://go.microsoft.com/fwlink/?LinkID=827546 . It gives you DotNetCore.1.0.1-VS2015Tools.Preview2.0.3.exe
You can get other related .Net Core SDKs from https://www.microsoft.com/net/download/core
If you have VS 2017, you don't need to install .Net Core SDK explicitly. You get it by default in VS 17.
Cheers!

"netcoreapp1.0" is an unsupported framework. - Asp.Net Core Music Store

I'm just trying out asp.net core for the first time. Opening up the newly updated music store app but I can't get it to build Nuget tells me:
Errors in C:\development\MusicStore\test\E2ETests\project.json
"netcoreapp1.0" is an unsupported framework.
How can I get the .net framework reference to restore?
RC2 was released yesterday, and now you can. You need:
Install tooling for VS2015 from https://go.microsoft.com/fwlink/?LinkId=798481 (link from step 1)
Upgrade NuGet (VS Extensions) - 3.4.3.855 (auto-updated) works for me, but version 3.5.0 (beta) is recommended here (second link in step 1).
Edit your global.json file - update version property to 1.0.0-preview1-002702 (details here)
In ASP.NET Core 1.0 RTM Tools Preview 2 the version needs to be:
"version": "1.0.0-preview2-003121"
(Run dotnet --version to make sure) Then don't forget to run:
dotnet restore
in your Package Manager Console, Command Prompt or Git Bash

MSBuild error - Solution is of version 12.00 which is not currently supported

I have a Build server which has TFS 2010 Build Service installed. I have 2 Build Agents and 1 Controllers configured. One of our projects have been converted to Visual Studio 2012.
I found out that .NET framework 4.5 comes with new version of MSBuild which is version 4.5.
I installed .NET framework 4.5 on the Build Server because prior to installing it every time the project was built I kept getting the following error:
"Solution is of version '12.00' which is not currently supported".
After installing .NET 4.5, I still run into the same issue.
How could I go about resolving this?
Do I have to configure the Build Agent to use the new MSBuild 4.5 in order to build this particular project or do I set something in the projects solution file itself? If so how?
I would really appreciate if somebody could assist me with this please?
Try install vs2012 on the build server, while i don't believe it's strictly needed it's the easiest way to get all the requirements installed.
We have installed VS2012 on the build agent. Interestingly when I RDC to the build agent and then run msbuild from the command line everything works fine. So the issue looks like it happens before we even get to MSBuild.