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

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

Related

ASP.NET Core 3.0 not showing on Visual Studio 2019

I want to test the new Blazor server-side framework (aka Razor Components).
I installed Visual Studio 2019 RC, and then the .Net Core 3.0 preview 2, following this official tutorial.
After the install, I only see the ASP.NET Core 2.0 and the 2.1 on the "Create a new ASP.NET Core Web Application" page. The 3.0 is not showing up.
I started to mess around, trying to install other packages from this page, uninstalled and reinstalled Visual Studio 2019, updated to the .NET Core Preview 3, installed several times the x64 and x86 packages in different orders, copy/paste the .Net Core binaries to random folders and so on. Nothing works. The ASP.NET Core 3.0 does not show up.
Here is what my VS looks like when creating a project (the yellow message appeared latter after some messing around with the packages, so it is not the real problem):
Here is the output of the dotnet --list-sdks command:
EDIT
For some reason, I installed the Blazor VSIX package (the WebAssembly - not exactly what I want, but I installed it anyways) and now the ASP.NET Core 3.0 simply shows up. However, just for the blazor templates:
I don't understand. Is there anything obvious I'm missing?
There is an option in Tools -> Options that enables preview versions of the .NET Core SDK. In the VS Preview shipping channel, it is on (by default, and not settable). In the VS Release channel, it defaults to off and you can opt-in.
(Note: it's disabled in the screenshot because I have a Preview build installed.)
The reason for this is to allow you to customize whether a project using a released version of .NET Core (such as 2.1, the current LTS) will use tooling from the newer not-yet-release-quality SDK.
Prior to 16.1, this option was located on the Tools -> Options -> Projects and Solutions -> .NET Core page.
Here is what I did to show .NET Core 3.0 in VS2019
Installed .NET Core 3.0 SDK (No Success)
Restarted VS2019 after installing .NET Core 3.0 SDK (No Success)
Updated VS2019 (Worked Perfectly)
I had the same issue. Here is what worked for me.
First, download the latest .Net Core 3.0 SDK (see 1,2 below).
Next, Check for updates (4,5). (this is what helped me the most)
Next, Enable Preview SDK (5,6,7,8,9) and restart
Now, the .net core 3.0 option should show (11).
It no longer works... again!
The SDK 3.0.100-preview8-013656 doesn't provide the ASP.Net Core 3.0 project template.
You have to uninstall it and install SDK 3.0.100-preview7-012821
https://dotnet.microsoft.com/download/dotnet-core/3.0
I have the same issue here after moving from Visual Studio 2019 Preview to Visual Studio 2019 RC.
This page seems to suggest that you need Preview to use .net Core 3.0 which is annoying.
https://dotnet.microsoft.com/download/dotnet-core/3.0
I looked up the difference between RC and Preview, and they pull builds from different channels (stable and preview).
The next thing I’m going to try is to go back to Preview to see if .Net Core 3.0 becomes visible again.
Tried to get .NET Core 3 (preview 8 in my case) to work in the release version of Visual Studio 2019 but ASP.NET Core 3.0 refused to show up in the "Create new ASP.NET Core web application" dialog.
What eventually worked was to install the Preview version of Visual Studio 2019.
I could have saved a few hours and a lot of hair if I had taken the warning text ".NET Core 3.0 should be used with the latest previews of Visual Studio." (https://dotnet.microsoft.com/download/dotnet-core/3.0) more literally...
In my case is because I did not installed Visual Studio 2019 with that feature. So just create a new project and type .net core. Then click on Install more tools and features:
Then add the following feature:
I had this problem and solved it as follows:
STEP 1: Download .NET Core 3.0
STEP2: Enable the ability to consume preview SDKs by default, As shown below:
I had the very same issue. I tried everything with no success
I already had only x64 version of .NET Core SDK
In addition i had to install x86 version too. That WORKED !!!
If your solution uses global.json and sdk:version isn't compatible with the target framework, it won't let you select it or it disappears from Target framework drop-down in your project's properties. You will need to update it to something like this:
{
"sdk": {
"version": "3.1.0",
"rollForward": "latestMinor"
}
}
I resolved it by installing
dotnet-sdk-3.1.403-win-x86.exe
dotnet-sdk-3.1.403-win-x64.exe
Because the visual studio was taking the SDK from "C:\Program Files (x86)\dotnet\sdk" once you install "dotnet-sdk-3.1.403-win-x86.exe" there will one folder under the above directory. then no need to restart your PC.
https://dotnet.microsoft.com/download/visual-studio-sdks?utm_source=getdotnetsdk&utm_medium=referral
ASP.Net Core 3.0+ just runs on vs2019 version 16.7+.
You need to go to help tab on your visual studio and check for updates and update it to the latest version
Note! (don't use it on your developer machine)
0- make sure you installed .net core 3 sdk. dotnet --list-sdks
1- make sure Tools -> Options that enables preview versions of the .NET Core SDK enabled.
2- uninstall all x86 version of .net core sdk from your machine.
3- restart visual studio and try to create a new project.
I was not able to get .netcore 3.0 preview8 working on my Visual Studio Community Edition (version 16.2.3). I opted to uninstall .netcore 3.0 preview8 and I installed .netcore 3.0 preview7 instead. After insalling .netcore 3.0 preview7 In Visual Studio I checked use previews of the .NET Core SDK option that is in Tools -> Options -> Preview Features and I restarted it. That worked for me, but if someone have .netcore 3.0 preview8 already working, help will be appreciated it.
I've encountered the same problem on a Mac and found a solution to this issue.
On visual studio update tab (Visual Studio -> check for updates) there is a option to change channel to "Preview".
After that you can download necessary updates and go using .net core 3.0
I noticed an interesting behavior. I had the latest version of VS with all the dependencies installed. But when I try to add a new project to the solution, the dialog does not show me the options beyond .Net Core 2.2
But When I create the new project from the startup page, the drop down does show the ASP.NET Core 3.1
So I was able to work around the issue by creating the new project from the startup page, then add the existing project to the solution.
I've had the same issue after installing .net core 3.1. This is how I resolved it.
open powershell, type dotnet --version, it returns '2.2.300'
go to 'programs and features', unistall .net core sdk 2.2.3.0
run dotnet --version again, it returns '3.1.302' and in VS 2019 it shows '.net 3.1'
This answer is for the newest .NET Core version as of 10/11/2020, which is .NET Core 5.0
Specs: VS Version 16.8.0
Target Version of .Net Core: 5.0
You must have version 16.8.0 in order to have .Net Core 5.0
If you still have problems with Visual Studio not showing .Net Core 5.0 in Visual Studio version 16.8.0 (and assuming you downloaded the .NET Core 5.0 SDK for Visual Studio), well, apparently (and correct me if I'm wrong) it is now called just .Net 5.0, omitting the Core.
After selecting .NET 5.0, I was able to install other libraries which are currently version 5.0+ and dependent on .NET Core 5.0+
Is the new name intentional? Anyways, here some evidence of this working (I was able to install the newest version of Newtonsoft and Entity Framework for .Net Core):
Funny enough, when I try to create a new .Net Core project, the version shows up as expected:
I'm very sorry for my English!
[PS: I'm literally copying&pasting this answer, which I answered somewhere else, but given that, when you Google this issue, this stackoverflow question appears first. So thats why I'm reposting]

How to update from Microsoft.NetCore.App 2.0 to 2.1.4

I created an ASP.NET Core Web API project in Visual Studio 2017 version 15.7.2.
When I created it, it was Microsoft.NetCore.App 2.0.
Now I want to update to Microsoft.NetCore.App 2.1.4 but I can't because Visual Studio tells me:
Implicitly referenced by an SDK. To update the package, update the
SDK to which it belongs
I download the latest version of .NET Core and I installed it, but I got the same issue.
Any ideas?
Don't confuse SDK (=> Build tools) versions with .NET Core versions.
The 2.1.* SDK versioning was unfortunate, the versioning scheme has since been changed and the scheme transition will be (mostly) complete with the release of .NET Core 2.1.
You don't need to update the Microsoft.NETCore.App NuGet package as it only contains build references needed to build your application.
For self-contained applications, you can also set the <RuntimeFrameworkVersion> property inside the csproj file, but starting with the .NET Core SDK 2.1.300, you no longer need to as it will know about the latest versions.
As Martin points out above, the SDK and .Net Core Runtime are separate entities.
I went to https://www.microsoft.com/net/download/windows and downloaded the latest SDK (2.1) and installed it on my local machine. You'll need to close any open VS instances to complete the SDK installation.
Open your project's csproj file and update netcoreapp2.0 to netcoreapp2.1 and while you're at it you can update the "Microsoft.AspNetCore.All" to version 2.1. This will save you from having to update the nuGet package.
Worked for me. Best of luck.

dotnet core version number and corresponding build

On dev server when i check dotnet core version number it shows
C:\>dotnet --version
Microsoft .NET Core Shared Framework Host
Version : 1.1.0
Build : 928f77c4bc3f49d892459992fb6e1d5542cb5e86
How do i find corresponding build/installation files on dotnet core download page
I am setting up a new server and i need to make sure i have the same version of dotnet core runtime installed as dev.
Also on the same note where can i find prevision vresions on Windows Server Hosting for dotnet core
Screenshot
Just search for the tags or releases inside the .Net Core Github repo or on the archives site on Microsoft.
But you should really upgrade to a version that is not end of life.

Visual Studio 2015 Created Old .NET Core 1.0.1 project

I have installed .NET Core 1.1 SDK and Tooling 1.0.1 Tools Preview 2.
When I create new .NET Core project using Visual Studio 2015 it creates 1.0.1 project instead of 1.1.
Not sure how to change this ugly behavior?
That's because the templates ship with Visual Studio, which haven't received an update as part of the .NET Core release. The reason for that is probably because 1.1 is a "Current" release and 1.0.1 is an "LTS" (Long Term Support) release. Visual Studio will most likely follow the LTS releases as they provide the best and most reliable support for customers.
If you create a new application with the .NET CLI tooling (e.g. dotnet new), it will use the latest version. You can specify the type of the template with the -t switch:
dotnet new: creates a console app
dotnet new -t web: creates a full-blown web app
dotnet new -t lib: creates a class library project

Basic bproject create Failed to create prime the Nuget cache

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