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

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!

Related

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.

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]

VS2017 : Target framework drop down does not show .NET Core 2.1 option

I have already installed VS2017 Enterprise 15.6.4. Recently installed .NET Core 2.1.101 SDK from official site
I was expecting .NET Core 2.1 as one of the target framework available if I create console or asp.net core application. Can someone help me understanding what I am missing here.
As suggested in comments, I installed 15.7 preview 2. Still no luck and same issue.
I have faced the same problem. I solved this by installing the right SDKs with Runtime for .NET Core 2.1.
Basically to run/create 2.1 projects from VS Preview, you need to install the "2.1.300" (not 2.1.4) .NET Core SDKs and Runtime. https://www.microsoft.com/net/download/dotnet-core/sdk-2.1.300-preview1 (this includes required Runtime already)
The good explanation of this misleading with versions i found here https://github.com/dotnet/cli/issues/8309 (dasMulli commented on Feb 24).
In case this helps someone else... After installing VS 15.9.2 my project that was working fine with 2.2 preview-3 stopped working. VS could not see the preview SDK. I could build the solution using dotnet.exe but not VS.
To solve this I created a global.json at the root folder of this solution pointing to the preview sdk. That allowed VS to see the preview version.
This is a change of behavior in VS between 15.8.x and 15.9.x.
To create the global.json you can navigate to the desired folder and type this:
dotnet new globaljson
Make sure dotnet PATH variables are in correct order
If you have installed an SDK for a different system architecture (e.g., if you installed 32-bit/x86 SDK on a 64-bit computer), then a new entry in the PATH variable would have been created for that specific location (e.g., C:\Program Files\dotnet or C:\Program Files (x86)\dotnet).
The problem is that Visual Studio, when searching for installed frameworks, will stop at the first PATH variable entry it finds that contains an SDK. So, if the first version you installed used an incorrect architecture, then you'll have to adjust the position of those entries before any of the correct SDKs will appear in the Target Framework drop down.
Source: this absurdly-hard-to-find comment within issue #8309.
TL;DR: Make sure the first "C:\Program Files\dotnet\" entry in your path variable you see in the list matches your system architecture:
64-bit = C:\Program Files\dotnet\
32-bit = C:\Program Files (x86)\dotnet\
Make sure that Visual Studio 2017 is up to date. Go to "Tools" -> "Extensions and Updates" to install visual studio updates. This resolved the issue for me.
I have faced the similar situation I tried to install the preview version of the dot net but it did not help.
However after I updated visual studio (from 15.8 to 15.9.6 ).
I Could see dot net core 2.1 in the target framework.
Updated to Latest VS 2017 and installed latest .Net Core SDK.
Changed global.json to point to latest version installed.
This resolved for me.
I had faced the similar issue. I then just updated my Visual Studio 2017 to 15.9.16 version and restarted the system. The problem got resolved.
I was facing the similar issue, I uninstalled the .Net Core 2.2 runtime and then from the below link:
https://dotnet.microsoft.com/download/visual-studio-sdks?utm_source=getdotnetsdk&utm_medium=referral
Install the .Net Core 2.2 Visual Studio SDK, Restarted the Visual Studio and my issue got resolved, .Net Core 2.2 is now getting listed in Target Framework list in the project properties in Visual Studio 2017 Version 15.9.16
I created a new project under .net core 2.1 and it was ok but in my old project have not appeared. So I opened both ".cproject" files and compared them together and found the problem.
Open your project's ".cproject" file in a text editor then replace below line
<TargetFramework>netstandard2.1</TargetFramework>
with this one:
<TargetFramework>netcoreapp2.1</TargetFramework>

Visual Studio 15.3.1 can't find core DLLs after update

I'm getting the runtime error:
InvalidOperationException: Can not find assembly file mscorlib.dll at '...\bin\Debug\net462\refs,...\bin\Debug\net462\'
This had not been a problem until I updated to version 15.3.1 this morning, and installed the .Net Core 2.0 SDK.
The DLL's are present in my ~\.nuget\packages folder. I'd had the same issue with the "Microsoft.Csharp.dll" assembly until I copied and pasted it into the stated folder.
I tried specifying to use .Net Core 1.1.0 via a global.json file, but then I get the build error:
The version of Microsoft.NET.Sdk used by this project is insufficient to support references to libraries targeting .NET Standard 1.5 or higher. Please install version 2.0 or higher of the .NET Core SDK.
This error goes away if I clean the solution then restore Nuget packages via Command Line- not via the GUI. However it comes back if I change the version of a nuget package.
OK, this seem slightly different to my issue here: Visual Studio update 2017 15.3.1 forces ASP.NET Core SDK 2.0, which then doesn't find "reference assemblies"
If you install the SDK 2.0 from https://www.microsoft.com/net/download/core
You will then "probably" be able to build and run the project again but you'll be back to having the missing Microsoft.CSharp.dll / mscorelib.dll error.
If you then make sure the dependency is correct for the netstandard version:
<DependsOnNETStandard>netstandard1.5</DependsOnNETStandard>
See here: https://learn.microsoft.com/en-us/dotnet/standard/net-standard for the right version for you. My project is using core 1.1 targeting the full framework 4.6.1 and targeting netstandard1.6 has worked for me.
The final piece of the puzzel, was found on the GitHub issues here: https://github.com/dotnet/sdk/issues/1488
Add the following to your references in the .csproj file:
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.0.0" />
This will then build the project as a 1.1 project, but using the 2.0 SDK (which from what I can tell, it's supposed to do!). I can now run the project, update packages and generally got on with my work!

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.