self contained app not publishing runtimes - asp.net-core

I have made an asp .net core 3.1 web application, it runs on localhost with no issues. When I want to publish my app I run into an issue:
HTTP Error 500.32 - ANCM Failed to Load dll.
After some analyzing, I found that when publishing the runtime folders do not publish to the remote server, altough the target runtime has been selected. I checked the publish profile just to be sure and there the runtime identifier is also in the document

Related

How manage "wkhtmltopdf" on .NET Core Api on IIS

I have a .NET Core 3.1 API calling wkhtmltopdf.exe to generate a PDF (using RotativaCore wrapper).
Its working fine with moderate usage... The problem when I have too many request at same time ...
Several 'wkhtmltopdf.exe" will stuck on Windows processes and I start to get several errors:
QEventDispatcher: Failed to create QEventDispatcherWin32 internal window: 87 Qt: INTERNALL ERROR: failed to install GetMessage hook This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.
How can I handle that?

Updating to .Net Core 3.1.12 caused 3.1.0 sites to break

Over the weekend our webserver was updated, and after that our website went down with the error "HTTP Error 500.31 - ANCM Failed to Find Native Dependencies", and we received this error message in the event log on all sites using .Net Core 3.1.0:
"The framework 'Microsoft.NETCore.App', version '3.1.12' was not found."
When we uninstalled 3.1.12, the sites came back online.
Is there a way to allow for .Net Core updates without sites going down?

HTTP 500 error launcing ASP.NET 3.0 application

I have just upgraded our ASP.NET Core 2.2 web application to 3.0. It builds and deploys fine. The problem is when I go to run it from our IIS server. This was running perfectly fine as a Core 2.2 web app, but now fails since upgrading to Core 3.0.
When I launch the web app from the commandline there are no reported errors.
When I launch the application from the browser the Windows logs indicate that the app started correctly.
The app then fails with an HTTP 500 error. Here are the IIS log entries.
We're using Windows Server 2012 R2 with IIS 8.5.9600.16384
The app appears to start correctly but then fails with an HTTP 500 error. Has anyone else seen this or something similar? Any ideas how to diagnose / fix the problem?
UPDATE
I've attached the VS 2019 debugger to the deployed app via the w3wp.exe process and it's not even hitting any of the middleware (I have a breakpoint at Startup() in Startup.cs).
I've tried changing the application pool settings e.g. identity, .NET version but to no avail.
When I launch the site from the web server I get the following error message which doesn't really tell me anything.
I can't see what's causing the problem.
.NET Core 3.0 uses the in-process hosting model by default. You may need to upgrade the .NET Core Hosting Bundle.
You will check web.config "aspNetCore"
<aspNetCore processPath="dotnet" arguments=".\Api.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
maybe proccessPath is wrong.
if it doesn't solve problem , write to log step step startup.cs.
Maybe throw error in startup.cs
After investigation and comparison of the build artifacts that the build produces vs the deployed app, I discovered that the appsettings.json was not being deployed. No idea how or when this started failing, but it caused the app to generate an HTTP 500 error message. Our app's Azure ADB2C settings are contained in this file so it was crashing trying to authenticate but couldn't find the authentication settings.
There was no obvious error being generated and everything seemed to be loading fine. It was at the point at which the app was trying to authenticate that it was failing. All working now.

Changing host name on development machine for ASP.net Core 2.1 MVC doesn't work (fine on MVC 5)

I want to change the local host name so http://localhost/app1 could, say, become http://app1 - for a few different ASP.net Core 2.1 MVC websites.
I'm using IIS in Windows 10. (I have all sorts of reliability issues with IIS Express every time I try it - I'd rather use full IIS).
I've followed this article:
https://www.mojoportal.com/adding-a-host-name-to-the-hosts-file-for-local-testing
changing the hosts file then adding new websites in IIS rather than adding applications under the default website.
I want to do this for various reasons including preventing passwords from autofilling across many websites on localhost.
This works fine on MVC 5 sites - but in .net Core 2.1 MVC sites I get a
HTTP Error 502.5 - Process Failure
If I look in the log - and I've tried this on various sites - I get an error such as this:
An assembly specified in the application dependencies manifest
(AppName.deps.json) was not found:
package: 'Stripe.net', version: '19.8.0'
path: 'lib/netstandard1.2/Stripe.net.dll'
This doesn't only happen for Stripe.
The deps.json file I guess is being dynamically created - I can't find it. The sites deploy to the server fine.
Why does this happen - and how can I change hostname away from localhost for .net core 2.1 MVC sites?
If I create a template .net Core 2.1 MVC site it lets me do it fine, strangely but can see no obvious differences.
I can't find anything on Google directly about this though I've looked for a few hours.
I found this - but it didn't help:
ASP .NET Core 2.0 Change "localhost" to a "hostname"
Thanks.
Update
A vanilla .net core mvc 2.1 application works fine but as soon as 1 nuget package is installed this error happens again:
An assembly specified in the application dependencies manifest
(hosttest.deps.json) was not found
So there's some path issue to nuget packages - can't find how to fix it though.

ADAL 3.1.203031538-alpha: Problems calling AuthenticationContext.AcquireTokenAsync() in ASPNET5 and ASPNET5Core

I am trying to write a library in ASPNET5 Core using VS2015 CTP6 that calls the Azure Service Management REST API. The code works fine in a .NET45 Console App.
In an ASPNET5Core Console App, the code fails silently on the AcquireTokenAsync call and the program terminates.
In an ASPNET5 Console App, the program won't even build with errors stating I must add a reference to System.Threading.Tasks and System.Runtime.
You can find a repo containing all three projects here:
https://github.com/npnelson/ADALSamples.git (make sure you read the readme on the repo for more information)
Are these bugs, or am I missing something?
The .NET Core support in the current ADAL Alpha is provided only for confidential client flows, that is - code behind of web applications and processes running on the server. Native clients on .NET core are not supported.