How manage "wkhtmltopdf" on .NET Core Api on IIS - asp.net-core

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?

Related

self contained app not publishing runtimes

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

ASP.NET Core 2.1 - Unable to start process dotnet.exe

After upgrading an application from .NET Core 1.0 to 2.1, I am receiving the following error when I try to debug it with IIS Express:
Unable to start process C:\Program Files\dotnet\dotnet.exe. The web server request failed with status code 502, Bad Gateway.
However, this only happens every second time I launch the application. Otherwise it works just fine if I just launch it again.
This creates a mild nuisance to my debugging process, as I constantly have to keep closing the error windows popping up.
The full response shows some additional info:
HTTP Error 502.3 - Bad Gateway
The specified CGI application encountered an error and the server terminated the process.
And the error code "0x80072efe" is shown.
Logging is enabled in web.config, but the crashing launches are not shown at logs at all. I have also tried looking Event Viewer for additional information, but I have not found anything.
The only fix for this I have found so far is to set Kestrel use libuv instead of sockets, but I have no idea why it works. Does anyone have any idea how to fix this?
I encountered the same problem after I upgraded, regardless of what I did it would always show the 502 error on the second load. It appears this problem was introduced in ASP.NET Core 2.1. I tracked it down to the asp-prerender-module tag in my view. Remove the prerender and it goes away.
I was able to fix the problem and keep my prerendering by upgrading to ASP.NET Core 2.2.

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.

How to implement working web server with Mono WebAPI application

Mono 3.2 MVC4 WebAPI application is running in Debian x64 VPS server. Mono is compiled from source and 4.5 subtree is used.
Application requires Chrome or Safari browser.
After refreshing browser window several times server does not work properly. I tried all known free possibilites:
Apache + mod_mono
After pressing browser refresh button several times server randomly returns 500 error for some pages
and apache error log contains "failed to map path" exception.
I posted it in
https://stackoverflow.com/questions/20356779/how-to-fix-failed-to-map-path-errors-in-mono-mvc4-application
and in
Mono ASP.NET mailing list without any response.
There are number of mono applications in server, maybe mod_mono selects wrong thread or is there some bug in webapi mapping implementation in mono.
Nginx + mono-fastcgi-server4.exe
Holding down F5 key causes 200% CPU usage forever in mono-fastcgi-server4.exe
I posted it in
https://stackoverflow.com/questions/20512978/how-to-limit-mono-197-cpu-usage-in-mono-fastcgi-server
and in
Mono ASP.NET mailing list without any solution.
Is looks like there is bug in mono fastcgi server or it is not compatible with mono 3.2
Using xsp4.exe directly
It causes "server does not return data" in Chrome if browser window is refreshed several times.
I posted this in
https://code.google.com/p/chromium/issues/detail?id=329311
without response.
Maybe xsp4 does not implement http protocol properly.
Havent tried ServiceStack since it cannot used for closed source development which is required. Also application uses also images, css, js files and MVC views which needs also served.
How to create proper server for mono which returns correct data ?
When 500 errors happen, somewhere in the mono class libraries an exception was thrown, you can find out more by using tracing:
mono --trace=E:System.Exception YourApp.exe
This way it's very possible that you find out what is causing the load problems you're seeing in each case (to do this for mono-fastcgi, you would need to add the trace argument in the script that calls mono-fastcgi-server4.exe).

Windows Server 2003 64bit IIS 6.0 Service Unavailable

I created a MVC 4 Web Api and ran all the configurations to get it running, but I get the error mentioned above.
The event log says I am running two version of .NET
I have enabled 32 bit applications on the server
This is the proof of .NET 4 Registration:
This is the error I am getting:
The setup for above error:
Clicking on configure from above screen:
Clicking on edit:
If I change the wildcard mapping dll to the follwing
I get this error, as you can see it says I am running version 2 of .net which is not true according to the first screenshot, I have tried iisreset to not avail:
The wild card mappings are used for clean url's when using MVC 4 web api.
This is the setup in IIS:
Can someone maybe guide me to a solution for this?
EDIT:
These are the resources for the initial setup I did:
http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx
http://johan.driessen.se/posts/getting-an-asp.net-4-application-to-work-on-iis6
Basically the IIS has framework 4 registered but it is using framework 2 when I try and load the api.