I Created a ASP CORE 1.1 project with docker support. it runs.
Now when i downgrade it to asp core 1.0 and run the docker mode i got
The target process exited without raising a CoreCLR started event. Ensure that the target process is configured to use
Microsoft.NETCoreapp 1.0.0 or newer [..]
When downgrading the solution the docker file doesn't get updated.
Update in docker file
FROM microsoft/aspnetcore:1.1
to
FROM microsoft/aspnetcore:1.0
Related
I'm trying to build a docker image with .NET Framework 4.8.
The Docker Windows image that I'm using is servercore:ltsc2019 (it has .NET Framework 4.7.2 preinstalled).
I've tried using:
ndp48-x86-x64-allos-enu.exe
chocolatey netfx-4.8-devpack
In every case, it gives the error 3010, which means it requires restart.
Suppressing error is failing docker build with error:
Encountered an error during Shutdown: failure in a Windows system call: The interface is unknown. (0x6b5)
or it's building with a broken .NET Framework installation.
What should be my approach here to update .NET Framework to 4.8?
I deduce that you have something which needs both 4.7.2 and 4.8?
Have you tried to do it the other way around?
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019
ADD http://go.microsoft.com/fwlink/?linkid=863265 /ndp472-kb4054530-x86-x64-allos-enu.exe
RUN C:\ndp472-kb4054530-x86-x64-allos-enu.exe /quiet /install
I have a .NET (Core) 5.0 solution with a global.json because I want to keep a specific SDK version:
{
"sdk": {
"version": "5.0.302"
}
}
5.0.302 is installed on my machine, and the solution opens in Visual Studio (for Mac) and builds just fine, but when I try to build with Docker from the command line I get:
A compatible installed .NET SDK for global.json version [5.0.302] from [/src/global.json] was not found.
The image used in my Dockerfile is:
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
I don't think I understand the global.json docs. I tried changing the version in global to 5.0.0 and adding rollforward: latestFeature. Now Docker will build, but Visual Studio won't build when I open the project:
.NET Core 5.0.0 SDK is required to build this application, and is not installed.
I expected VS to use the installed 5.0.302 in this case, but it doesn't.
While a 5.0.302 SDK isn't listed in the Microsoft registry, it was available when I tried to pull it.
Try changing your Dockerfile to
FROM mcr.microsoft.com/dotnet/sdk:5.0.302 AS build
I don't know how often Microsoft clean their registry, but you should probably be prepared for the image to disappear at some point.
If you can, I'd advise you to not rely on a specific version of the SDK.
I have created a sample .NETCORE web API, and I'm trying to deploy to docker, I get below errors, could some one help on how to resolve this.
Below screenshot of docker file and error from Visual Studio code
docker file
docker file content1
List of asp.net core runtimes Installed in my local machine
From the screenshot, we can see you have installed the Asp.net Core 5.0.2 and 5.0.5 version runtime and SDK, without the Asp.net Core 5.0.0 Version.
So, to fix this issue, you could install the Asp.net Core 5.0.0 version SDK and runtime. Or you could use the existing Asp.net core version to create docker image.
Maybe you need to pull a new version for the dotnet image .
check these:
link1
Link2
My case was with docker because the message was always: the framework 'microsoft aspnetcore app version '5.0 0 was not found at runtime so in the document .Dockerfile add
=> FROM mcr.microsoft.com/dotnet/runtime:5.0 AS base
and
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
was working with workerservice and it worked.
I'm trying to pull from mcr.microsoft.com/dotnet/framework/sdk:4.5 but get the following output: manifesto for mcr.microsoft.com/dotnet/framework/sdk:4.5 not found: manifest unknown.
I am new to docker and can't find this answer anywhere online. I've tried switching to a windows container and that didn't help.
So I solved this by using the latest .NET Framework 4.8 version. I then had to switch to windows containers through the Docker App.
I have a ASP.NET Core application running in a Docker container (2.1-aspnetcore-runtime).
The docker container with the application ran without any problems for two months. Recently I had to update a ConnectionString in the AppSettings. So I changed the JSON file and deployed a new docker version.
This resulted in the following message:
It was not possible to find any compatible framework version
The specified framework 'Microsoft.AspNetCore.App', version '2.1.6' was not found.
- Check application dependencies and target a framework version installed at:
/usr/share/dotnet/
- Installing .NET Core prerequisites might help resolve this problem:
http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
- The .NET Core framework and SDK can be installed from:
https://aka.ms/dotnet-download
- The following versions are installed:
2.1.4 at [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Why does the application suddenly need the version "2.1.6"? The application didn't change and two months ago the version "2.1.6" didn't even exist.
Besides this there is a specific Docker container for "2.1.6" (2.1.6-aspnetcore-runtime). Why isn't the newest version available in the normal "2.1-aspnetcore-runtime" container?
Why does the application suddenly need the version "2.1.6"? The application didn't change and two months ago the version "2.1.6" didn't even exist.
This one is easy to explain. The newer, ASP.NET Core 2.1 (and later) templates are generated with implicit versioning for Microsoft.AspNetCore.All/Microsofot.AspNetCore.App packages.
In ASP.NET Core 2.1 or later, you can specify the Microsoft.AspNetCore.All package reference without a version. When the version isn't specified, an implicit version is specified by the SDK (Microsoft.NET.Sdk.Web). We recommend relying on the implicit version specified by the SDK and not explicitly setting the version number on the package reference. If you have questions about this approach, leave a GitHub comment at the Discussion for the Microsoft.AspNetCore.App implicit version.
Your entries in csproj will then just look like
<PackageReference Include="Microsoft.AspNetCore.All" />
instead of
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.4" />
This makes sure that every rebuild will use/pick up the latest minor packages available on the system. That applies for portable apps. Self-contained basically do the same, but with the runtime available at the publishing time.
That is whats causing the issue for you in the first place.
Why isn't the newest version available in the normal "2.1-aspnetcore-runtime" container?
You probably didn't run docker pull microsoft/dotnet:2.1-aspnetcore-runtime before creating/building (or running) your docker container.
When you don't do that, it will use the latest locally tagged version (but not the latest version available for that tag on docker hub), because the microsoft/dotnet:2.1-aspnetcore-runtime will point to a newer minor versions when they come out, but this requires you to do a new pull to get the most recent version for the (re)tagged image.