I am following microsoft documentation to deploy .Net core with sql. when I go to my website the following is displayed:
An error occurred while starting the application. .NET Core X86
v4.1.1.0 | Microsoft.AspNetCore.Hosting version 1.1.2 |
Microsoft Windows 10.0.14393 | Need help?
When I run the app on local machine there are no errors and I am able to add toDo Items.
In my CsProj file:
<TargetFramework>netcoreapp1.1</TargetFramework>
I have seen other people with similar issue discuss a global.json file, but i do not see any and am not sure if I should create one and what exactly to put in it.
Possibly Related info:
When I push to azure in command line I get this error:
warning NU1701: Package 'Microsoft.Composition 1.0.27' was restored
using '.NETPortable,Version=v0.0,Profile=Profile259' instead of the
project target framework '.NETCoreApp,Version=v1.1'. This package may
not be fully compatible with your project. remote: Restore completed
in 269.7 ms for D:\home\site\repository\DotNetCoreSqlDb.csproj.
the deployment is successful though.
You could try to add the below to the <PropertyGroup> element in your DotNetCoreSqlDb.csproj
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
This is because the Microsoft.Composition 1.0.27 is an old nuget package which does not compatible with the your project target framework which is .NET Core 1.1.
The supported framework for the Microsoft.Composition 1.0.27 is as below:
Supported Platforms:
.NET Framework 4.5
Windows 8
Windows Phone 8.1
Windows Phone Silverlight 8
Portable Class Libraries
Reference: Package Microsoft.Composition 1.0.27 is not compatible with netcoreapp1.1
Related
I have a .net core 3.1 project. The project has a dependency on Microsoft Identity Platform and SQL Server.
While publishing the project to Azure. I am not able to configure the Microsoft Identity Platform. It gives below Error window.
I am able to configure SQL Server dependency but not sure why it is not able to configure Identity Platform.
I am using
.Net core 3.1.4
Visual Studio Community Edition 2022
Asp.net core Identity Entity Framework 3.1.4
Any idea?
Because you didn't install the dotnet-msidentity tool.
You can try to open the cmd black window and execute this command following this document.
dotnet tool install Microsoft.dotnet-msidentity -g --version "1.0.0-preview.1.21212.1"
This command will solve your issue. But then you will meet another issue like screenshot below if your account has multiple tenant.
Someone met this issue too and raised a ticket to ms.
You may search for known issues here if you meet some other weird questions when using vs2022.
dotnet tool uninstall --global Microsoft.dotnet-msidentity
dotnet tool install Microsoft.dotnet-msidentity -g --version "1.0.2"
worked for me
if you have nuget problems make sure you habe a nuget.config in the directory you are running the command
Make sure nuGet is set as the first or default package source in Visual Studios.
Right click on the project, click on manage nuGet packages and click on the gear next to Package Source.
Verify that nuget.org is setup as the first package source.
I have two .net core applications running on Linux.
One of them is happy with .net core runtime while another one is demanding .net core SDK.
I can build both applications using dotnet publish with the following parameters:
dotnet publish Web/Web.csproj -o publish -c Release -r linux-x64 --self-contained false
Both projects target 3.1 (checked .csproj):
<TargetFramework>netcoreapp3.1</TargetFramework>
I am deploying them to the same VM server which has .net 3.1 runtime installed:
.NET Core SDKs installed:
No SDKs were found.
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.10 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.10 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
However, on start of one of those projects as systemctl service I am getting an error:
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
While I can successfully start the application manually using dotnet Web.dll
Does my build artifact requires SDK?
Any ideas how can I troubleshoot this behavior?
1- No, it shouln't require SDK
2- Hard to help you with the incomplete question
Have you tried to run the service with SDK installed? To check if that is the actual problem or just a misleading error.
Are you using Systemd integration package by Microsoft?
dotnet add package Microsoft.Extensions.Hosting.Systemd
I have just setup up IIS 10 on a clean Server 2016 hosted server, and installed the following packages that I have gleaned should be on the machine to allow IIS to host ASP.NET Core applications:
aspnetcore-runtime-2.1.0-win-x64.exe
dotnet-hosting-2.1.0-win.exe
dotnet-runtime-2.1.0-win-x64.exe
I have installed my app straight into the Default Web Site and replaced all files in C:\inetpub\wwwroot\ with my app files. I also did assign the web site an app pool with no managed code, so that isn't my problem.
Last time my app was built with 2.0, and I installed the latest versions of the above packages, which I'm sure was 2.0, and the only error I had was that the command dotnet that IIS uses to invoke Kestrel to run the site, was not in the PATH env. variable
Now when I try and browse to localhost on the Server 2016 machine, it gives me the following error, found in the Windows event log:
Application 'MACHINE/WEBROOT/APPHOST/DEFAULT WEB SITE' with physical
root 'C:\inetpub\wwwroot\' failed to start process with commandline
'dotnet .\QuickDrive.Mvc.dll', ErrorCode = '0x80004005 : 8000808c.
Initially I tried with the same build as before, which was 2.0, and when I got this error, I rebuilt the app to target 2.1. Nearly every search result and relevant SO answer I can find suggest a version conflict, but now there should at least be no version conflict between the runtime and hosting package on the server. Maybe there are other version conflicts I am not aware of though?
At very least I'm asking for some advice on how to get more detailed diagnostic information, even if I don't get an answer that tells me straight what config options and versions to check on Windows and on IIS.
You have to install the Core SDK for whatever version you want to target in Visual Studio. Installing the runtime alone won't do the trick. You may have the restart Visual Studio afterward to see it in the list.
Here is a link to the SDK 2.1 download (the latest as of this writing).
I solved the problem by running dotnet myWesite.dll in PowerShell, and first I found that dotnet.exe was not in the PATH environment variable, and after fixing that, running dotnet myWesite.dll again gave me a meaningful error message that an assembly was missing because it had not been included when I published the website.
I faced the same error on the dev machine in IIS Express. MVC App stopped working all of the sudden. Eventlog gave the 0x80004005 error code.
After trying multiple suggestions, the solution to debug the wired error code was to run the app in the console:
[Project bin folder]> dotnet [projectname].dll
It appeared that during the NuGet package update, the dotnet core version was accidentally updated to 2.1.4 where as the installed version was 2.1.3
[could be a bug in Nuget manager as the update was from there]
I edited the project file to reference the available version (2.1.3) and the app started to work properly.
When publishing an ASP.NET Core application to a Linux server running nginx, is it necessary to install the .NET Core runtime on the server?
One of the options when publishing a .NET Core application is self contained deployments which include a version of the .NET Core runtime.
They are described (in the above link) as:
For a self-contained deployment, you deploy your app and any required third-party dependencies along with the version of .NET Core that you used to build the app. Creating an SCD doesn't include the native dependencies of .NET Core on various platforms, so these must be present before the app runs.
So your target machine will still need to have the libraries that .NET Core relies on, but it's entirely possible to publish you application and not have the .NET Core runtime installed on your target server.
Creating a SCD, you need to make a few changes to your csproj
<PropertyGroup>
<RuntimeIdentifiers>win10-x64;osx.10.11-x64</RuntimeIdentifiers>
</PropertyGroup>
The above would inform MSBuild that you want to target 64 bit Windows 10 and OSX 11.10.
Then you can create a published version of your app for one of those run platforms by running the following commands:
dotnet publish -c Release -r win10-x64
dotnet publish -c Release -r osx.10.11-x64
(the first line creates a SCD for Windows 10 64 bit, and the second does the same for OSX 10.11 64 bit.
Source: Self-contained deployment without third-party dependencies
I just installed JetBrains Rider and initiated a .net core MVC app. It finished generating the initial files and shows MvcApplication(load failed). I installed .net core from its own website and 'dotnet' command is working as dotnetcli is also installed. The error message displayed is "Solution 'MvcApplication' load failed. Rider was unable to detect a Mono runtime on this machine. We strongly recommend to install the latest version of Mono."
Why is mono required if I have already installed dotnet core?
For now Rider doesn't support .net core msbuild. You have to install mono and msbuild along with .net core, see https://rider-support.jetbrains.com/hc/en-us/articles/207335749-Using-Project-Rider-under-Linux-prerequisites
We're going to fix it soon =)