Therewere a couple of scenarios in (legacy)
ASP.NET where blocking was unfortunately necessary:
ASP.NET MVC filters and child actions. However, in
ASP.NET Core, the entire pipeline is fully asynchronous; both filters and view components execute asynchronously.
However, I still recommend that you use it in your core libraries - anything that may be reused in other applications. If you have code in a library that may also run in a UI app, or legacy
ASP.NET app, or anywhere else there may be a context, then you should still use ConfigureAwait(false) in that library.
The legacy
ASP.NET SynchronizationContext is an actual synchronizing context, meaning that within a request context, only one thread can actually execute code at a time. That is, asynchronous continuations may run on any thread, but only one at a time.
ASP.NET Core does not have a SynchronizationContext, so await defaults to the thread pool context. So, in the
ASP.NET Core world, asynchronous continuations may run on any thread, and they may all run in parallel.
As a contrived example, consider this code, which downloads two strings and places them into a list. This code works fine in legacy
ASP.NET because the request context only permits one continuation at a time:
If I log onto the server and click on the exe in my deployed directory it opens a command prompt and shows my site on port 5000. If I access the site on :5000 it works perfectly so the problem is to do with IIS and not the site itself.
I'm using dotnet to run the published ASPNET Core 2 web api dll. The problem was revealed by opening a command prompt and navigating to the directory where the site files are located. Once there, I ran the command:
Pressing enter, it immediately crashed giving the exact feedback in the console window of what was wrong. That's a great way to help determine your startup error(s) if you are having similar troubles.
I had a similar issue. I just followed the Troubleshooting steps: Check the system event log for error messages and found the following from the Event Viewer, Application 'MACHINE/WEBROOT/APPHOST/[MyFolder]' with physical root 'C:\inetpub\wwwroot\[MyFolder]\' failed to start process with commandline 'dotnet .\MyApp.dll', ErrorCode = '0x80004005 : 80008083.
The issue for me was that I had a space in my project name: App WebAPI.dll. So when "dotnet .\App WebAPI.dll" tries to execute it fails because it's really trying to execute "dotnet .\App" and forgetting the second part after the space.
First, I didn't have all parts of the .NET Core Windows Server Hosting bundle installed. I ended up doing a fremework-dependent deployment instead of a self-contained deployment. We have a lot of apps and don't want/need each on their own versions of .net core. There would be way too many versions of .net on the box.
I had the same problem with Visual Studio transforming the web.config file and changing the processPath and arguments. As outlined on the Microsoft site you can add the exclusion in the project.csproj file:
I faced the same issue and nothing from this thread worked out for me. So I looked into Windows Event Viewer and found that the user didn't have sufficient permissions to create/modify database as I was using EF core DB migrations. Fixing the authorization solved this issue.
I wanted to be able to run my .Net Core based API from IIS from my development directory without fighting with the web.config file. Visual Studio is controlling the web.config based on the project profile settings. You just need to add an IIS profile to your debug start so that VS knows what to do with your web.config. Instructions are here.
Now I can just code a bit, compile and refresh my browser without waiting for a browser launch, and without losing my query string each time. Clicking Debug automatically attaches VS to IIS for debugging, which means no more manually attaching the debugger to w3wp, which is something that has annoyed me for ages. Perfect!
Oh guys, My site was also working fine and all of sudden it started to show this error. My site was hosted under go daddy. Their technical team was also helpless to figure out the exact issue. I tried all the comments above none of them were working fine. So after spending a lot of time what resolved is,
I kept processPath as it is like processPath="dotnet" in my web.config, Just before showing this error i did some changes to my appsettings.json file to update my connection string. I edited it using filezilla (using view/edit option) in my local machine. So it might got corrupted i guess, which also caused this issue.
So what i did is, i published my project locally once again and i did my connection string updates locally in my appsettings.json and deployed this latest changes to godaddy. After this deployment my site started to show up again.
Application '/LM/W3SVC/8/ROOT' with physical root '' failed to start process with commandline 'dotnet ..dll' with multiple retries. Failed to bind to port '2118'. First 30KB characters of captured stdout and stderr logs from multiple retries: [end of message]
C:\Program Files\dotnet>If you are using command prompt and getting message that 'dotnet' is not recognized as an internal or external command, operable program or batch file" then first check the above path. If you found the above path then just copy it and set it as an environment variable of your PC.
In my case this HTTP Error 502.5 happened when I cloned some pretty old git repositories which contained web projects targeting .NET Core 1.1... sometime ago I uninstalled .NET Core 1.1 runtime from my Windows machine.
As it turns out, from diving into the .NET source code at , because the assembly name ended with "-DotNet.exe" (or maybe just DotNet.exe), it was going down the path of assuming it was supposed to run as a stand-alone app. Hence the complaint about missing arguments. I tore my hair out over this for a good long time before a search for the error string from the Windows Event Log took me to the source file.
In recent years the .NET Team has been heavily advertising
ASP.NET Core as one of the fastest web frameworks on the market. The source of those claims has always been the TechEmpower Framework Benchmarks.
TechEmpower is a software agency located in Los Angeles, California who run an independent framework benchmark on their servers. They publish all the results on their website as well as the framework code on GitHub.
The first thing that stood out to me was that the last official round (Round 21) was captured on 19th July 2022. The round before that (Round 20) ran in February 2021, which means there was a gap of more than a year between those two official rounds. I am not sure why they have only so few official rounds but I also discovered that they have a continuos benchmark run which can be viewed on their Results Dashboard. However, since the last official round was not that long ago and the difference between the results from Round 21 and the last completed run from the continuous benchmarks is not that big I decided to stick with Round 21 for my further analysis.
The Fortunes benchmark is the gold standard of all benchmarks. It is the only one which tries to resemble a "real world scenario" which involves some reading from a database, sorting data by text, XSS prevention and it includes some server-side HTML template rendering too.
To my astonishment
ASP.NET Core ranks 9th in place amongst the top 10 fastest frameworks! Two further flavours of the
ASP.NET Core benchmark also rank 13th and 14th out of the 439 completed benchmark runs. That is very impressive indeed!
However, those are self-chosen names (by the .NET Team) and in order to get a real picture of what is being tested one has to look at the actual code itself. Luckily all the code is publicly available on GitHub.
I'm not interested in checking out 15 different implementations of various
ASP.NET Core benchmarks so I decided to focus on the top performing ones by further narrowing down the 15 benchmarks into the best 7 out of the bunch:
I removed the Mono benchmarks and all the tests which used MySQL as the underlying database, because those tests performed significantly worse in comparison to the .NET Core with Postgres equivalents (which has the pg suffix in the labels).
Slowly the picture becomes clearer. The above screenshot also includes the framework "classification" which can be seen on the right hand side of the image. The top benchmark (which is the impressive one that ranks 9th overall) is classified as "Platform". The next three benchmarks are classified as "Micro" and the last three benchmarks are classified as "Full". There seems to be a very significant performance drop as one moves from the "Platform" tests down to the "Full" tests.
Similar to the naming of the framework benchmarks, the classification is not standardised or audited by TechEmpower employees either. Anyone can submit code with an arbitrary name and classification and get very little or no scrutiny at all by the repository maintainers. At least that was my impression (I once submitted an F# benchmark test).
Both of these web applications are very different so it is important to understand which one is used by which benchmark. This can be done by inspecting the config.toml file and the associated Dockerfile for the respective test case.
To my surprise this was also the only thing which I could recognise as an "
ASP.NET Core" thing. The web application itself is not even initialised via one of the many
ASP.NET Core idioms. Instead it creates a custom BenchmarkApplication as the listener on the configured endpoint.
An untrained eye might be thinking that builder.UseHttpApplication() is a method that comes with Kestrel, but that is not the case either. The extension method as well as the HttpApplication class which is in use here are not things which you'd find in the actual
ASP.NET Core framework. It is yet another custom class specifically written for this benchmark:
3a8082e126