Upgraded ASP.NET5 from beta-4 to beta-5 following the instructions on Microsoft's site:
http://blogs.msdn.com/b/webdev/archive/2015/06/30/asp-net-5-beta5-now-available.aspx
Got ton's of compile errors (1900+) like I was missing core .NET stuff (System.Object not defined, etc). I followed the solution posted at this other similar question: Error Upgrading from ASP.NET 5 Beta 4 to Beta 5 But this did not resolve the issue. I now get errors that the following runtime could not be found: dnx-clr-win-x86.1.0.0-beta5
If I run the command "dnvm list" I get the following output:
Active Version Runtime Architecture
------ ------- ------- ------------
1.0.0-beta4 clr x64
1.0.0-beta4 clr x86
1.0.0-beta4 coreclr x64
1.0.0-beta4 coreclr x86
* 1.0.0-beta6-12254 clr x86
1.0.0-beta6-12254 coreclr x86
So dnvm upgrade skipped over beta5 and went straight to beta6, but it appears some things are still looking for beta5. Is there a way to force dvnm to install beta5?
I've attempted to run the command:
dnvm install 1.0.0-beta5
Which results in the error:
'dnx-clr-win-x86.1.0.0-beta6-12254' is already installed.
Notice it says beta6 for the error! Perhaps it's being used as an alias for beta5 or it's just not possible to install earlier versions?
dnvm installs from the release feed by default. We've branched for beta6 and beta5 is not longer on that feed.
To solve the issue, set the DNX_FEED variable:
set DNX_FEED=https://nuget.org/api/v2
dnvm install 1.0.0-beta5
PS: I've opened a bug to track this. It would be nice to have a regular argument to specify the feed.
Related
After moving the application I get this error. I have downloaded and installed SDK 3.1.302 and runtime 3.1.6 but I get this error:
HTTP Error 500.31 - ANCM Failed to Find Native Dependencies
Common solutions to this issue:
The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found.
Specific error detected by ANCM:
It was not possible to find any compatible framework version The framework 'Microsoft.AspNetCore.App', version '2.2.0' was not found. - The following frameworks were found: 2.1.20 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] 3.1.6 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] You can resolve the problem by installing the specified framework and/or SDK. The specified framework can be found at: - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.AspNetCore.App&framework_version=2.2.0&arch=x64&rid=win10-x64
On the SDK .net core download page it says 2.2 is no longer supported and so I downloaded. 3.1.302 as recommended.
However, I think I need to find somewhere in my VS 2019 for that solution and change it to 3.1.6 runtime from 2.2 but I have no idea where that would be.
I looked on the web for a solution but could not find one. I found a mention of removing this
environment variable but that didn't work.
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
Where is my app referencing .net core 2.2? It worked so well on Windows 7 Visual Studio 2017 that I moved it from.
Under project csproj file configuration you have something like <RuntimeFrameworkVersion>2.2</RuntimeFrameworkVersion> or <TargetFramework>netcoreapp2.2</TargetFramework> or <PackageReference Include="Microsoft.AspNetCore.All" Version="2.2" />?
And 2.2 is no longer supported you need back to 2.1 or 3.x. I suggest you to upgrade project to latest version if is it possible.
or you can still download the SDK 2.2 from archive.
https://dotnet.microsoft.com/download/dotnet-core
Installing .Net Core 3.1 does not install the older runtimes by default. You will need to install 2.2, or when you publish your program, publish it as "Self-contained" which should include everything needed to run it.
While 2.2 has been EOLed, you can still run your .net core 2.2 program. You can download the last 2.2 runtime here: https://dotnet.microsoft.com/download/dotnet-core/2.2
You will likely want the Windows Hosting Bundle.
Install that, and once it's complete, you can check your runtime version from powershell with dotnet --list-runtimes
You should see a list of installed runtimes come up. You will want to see something like: Microsoft.NETCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
With that you should be able to run the application.
That being said, I would also recommend updating to 3.1 as soon as possible.
I installed aspnet core runtime (aspnetcore-runtime-3.1.3) on a centOS 7 server.
following this guide from microsoft documentation: https://learn.microsoft.com/en-us/dotnet/core/install/runtime?pivots=os-linux#download-and-manually-install
my server doesn't have internet connection.
After installation, when I run any command, e.g.
dotnet --info
it says it can't find any installed dotnet sdk:
$ dotnet --info
It was not possible to find any installed .NET Core SDKs
Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
https://aka.ms/dotnet-download
Host (useful for support):
Version: 3.1.3
Commit: 4a9f85e9f8
.NET Core SDKs installed:
No SDKs were found.
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.3 [/home/myuser/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.3 [/home/myuser/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Previously, I downloaded the rpm package and installed it with rpm -ivh command, same result
What can I do to fix this?
Note that I don't have internet access in the server
EDIT: The problem: I don't need SDK to run this command or any command I am using.
Anyways I've tried installing SDK, it says it can't find any compatible frameworks
What is the problem? you just installed runtime, and the error says there is no sdk.
You installed the .net runtime but didn't install the any sdk. for you to be able use asp.net core you need to install both. you can visit asp.net core documentation for the difference between them. but you can just visit https://dotnet.microsoft.com/download to download the appropriate sdk you need.
nb: I assume you are doing this from a gui. i'm sure there are commands for installing the asp.net core runtime and SDK from command prompt. but what is important is that YOU ARE MISSING THE SDK!!
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!
I am not sure if it is possible but I want to change dnx version when dnx . run from Visual Studio Code.
Even if my current dnx version is 1.0.0-beta5-11682 coreclr Visual Studio Code runs with 1.0.0-beta4 mono
Is it possible to change default dnx version of Visual Studio Code?
dnvm use VERSION -p
where -p is persistent, you can use without it to set version just for the current session.
example
dnvm use 1.0.0-beta4
or
dnvm use 1.0.0-beta4 -p
dnvm use <runtime_version> -r <runtime> -a <architecture> -p
examples:
<runtime_version>: 1.0.0-rc1-update2 etc.
<runtime>: mono, clr, coreclr (optional)
<architecture>: x64, x86 (optional)
-p: makes the results persistent (optional)
Selecting Active:
You have to provide the Runtime version as well, if there are multiple choices for the same name. For example type the following:
dnvm use 1.0.0-beta4 -r mono
If you would have to provide Architecture as well, the following command would apply:
dnvm use 1.0.0-beta4 -r mono -arch <architecture>
where can be "x64" for example, without the quotes.
Setting Default:
dnvm alias default 1.0.0-beta5-11682 -r coreclr -arch x64
Please note that, there were a bug (about May, 2015), in which referring to a CoreClr runtime by alias was not working. I don't know if it's fixed yet, but I guess so. Source: Issue 175 about the bug.
You can either set a version in the global.json file (like so https://github.com/OmniSharp/omnisharp-roslyn/blob/master/global.json#L4) or use the combination of dnvm alias and dnvm use. OmniSharp (the C# brain used by VSCode) will first check the global.json file and then go with the default-alias. All the details can be found here: https://github.com/OmniSharp/omnisharp-roslyn/blob/master/src/OmniSharp/AspNet5/AspNet5Paths.cs#L45
I tried to change the Target Framework on my app recently from .NET Framework 4.5 to 4.5.2, but if I do I get the following error when trying to build: "'Forms' is not a member of 'Windows'" (that is, System.Windows.Forms). Changing to 4.5.1 works normally. I'm using Visual Studio 2013 Ultimate.
I had this error when changing to 4.5.2.
In my case the error was related to a MessageBox ... I replaced: "Windows.Forms.DialogResult.Yes" (which caused the same error message) with "System.Windows.Forms.DialogResult.Yes" which did the trick.
I had the same problem, me too with Windows.Forms.DialogResult enumeration values.
The project automatically imports System and System.Windows.Forms namespaces and worked fine up to 4.5.1.
In 4.5.2 I had to remove Windows.Forms. and just leave DialogResult.Ok (or whatever else) in my code, it seems to be a problem with namespaces resolution.
Make sure that you add System in front of the Windows.Form.
I ran into this with an application still targeted to .NET 4.0, where it failed on one (new) build server, but ran on my older ones.
I narrowed it down to the .NET 4.0 Targeting Pack only being installed on the old build servers. Targeting pack is included in Visual Studio, or the Windows 7.1 SDK. It is for some reason not distributed separately, and with support ending for .NET 4, 4.5 and 4.5.1, I don't suspect this is likely to change. Because my older servers have been around a couple years, they've gone through in-place upgrades and so had the targeting pack already.
When you install Windows 7.1 SDK on Server 2012R2, it complains something to the effect of "A pre-release version of .NET 4 is installed, please install the RTM version". As far as I can tell, it's simply because a newer version) is installed -- Server 2012R2 comes with 4.5.1. I tried to uninstall all newer versions, but was unable to get the SDK to install the targeting pack.
So to install:
Download the Windows 7.1 SDK ISO image
Unzip it
Run Setup\MTPack\netfx_dtp.msi EXTUI=1
You should now have a %programfiles(x86)%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\ folder with the 4.0 stuff.
(EXTUI=1 bypasses the restriction that it can't be installed separately).
This allowed me to compile projects still targeting 4.0 (or re-build old revisions/branches that were targeting it at the time).