174

I was experimenting with a new feature that comes with .NET core sdk 2.2 that is supposedly meant to improve performance by around 400%.

Impressive so I tried it out on my ABP (ASP.NET Boilerplate) project

Template asp.net core mvc 4.0.2.0

I added the following to my web.mv.cproj file

  <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" />
    <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
  </ItemGroup>

Unfortunately I do not think this version of the ABP framework is compatible as the project simply fails to run and throws: (eventually)

HTTP Error 500.30 - ANCM In-Process Start Failure

I checked the logs after setting stdoutLogEnabled="true" in the web.config and re-trying - but no entries.

Has anybody had any success running the current ABP against a asp.net core in process setup?

I'm thinking this may be something only available in ABP vNext.

John Smith
  • 7,243
  • 6
  • 49
  • 61
jazb
  • 5,498
  • 6
  • 37
  • 44
  • check whether there is public function which is not having POST attribute. Make it private – Mohan Jul 06 '20 at 13:55
  • I dont seem to be able to add a post, so ill comment here. My problem started when migrating from core 2.1 to core 3.1, and the issue was with event logs. I hadn't set up the area in the event log for the logging to log to – thatOneGuy Jan 13 '21 at 14:23
  • Mine problem was I added this code in startup file app.UseFileServer(new FileServerOptions { FileProvider=new PhysicalFileProvider( Path.Combine(Directory.GetCurrentDirectory(),"pdfs")), RequestPath="/publish" }); and forget to create pdfs folder there – rahularyansharma Jun 27 '21 at 05:22

54 Answers54

171

In ASP.NET Core 2.2, a new Server/ hosting pattern was released with IIS called IIS InProcess hosting. To enable inprocess hosting, the csproj element AspNetCoreHostingModel is added to set the hostingModel to inprocess in the web.config file. Also, the web.config points to a new module called AspNetCoreModuleV2 which is required for inprocess hosting.

If the target machine you are deploying to doesn't have ANCMV2, you can't use IIS InProcess hosting. If so, the right behavior is to either install the dotnet hosting bundle to the target machine or downgrade to the AspNetCoreModule.

Source: jkotalik (Github)

Try changing the section in csproj (edit with a text editor)

  <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
  </PropertyGroup>

to the following ...

 <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
    <AspNetCoreModuleName>AspNetCoreModule</AspNetCoreModuleName>
 </PropertyGroup>

Source (Github)

Wouter Vanherck
  • 2,070
  • 3
  • 27
  • 41
Adam Mikulski
  • 1,750
  • 1
  • 8
  • 3
  • 1
    I used your suggestion but changed it to `InProcess` and it seems to work fine. Thanks! – jazb Dec 18 '18 at 00:43
  • 2
    I also had to change InProcess to OutOfProcess hosting in web.config – cah1r Jan 30 '19 at 11:11
  • 1
    I'd like to note that including `AspNetCoreModule` breaks debug output on VS2017. [https://github.com/aspnet/AspNetCore/issues/6609](https://github.com/aspnet/AspNetCore/issues/6609) – Eric Apr 18 '19 at 15:28
  • 1
    This fundamentally changes how the site runs on IIS tho? – hanzolo Jun 07 '19 at 21:53
  • As of 2.2.301 this no longer appears to be an issue at least for VS2019. However there are a few other issues mentioned in some of the answers below that cause the same error message to appear. At the time of this comment the issues mentioned are by [S.Mann](https://stackoverflow.com/a/55696709/1467005) and [Cory Koch](https://stackoverflow.com/a/56977776/1467005) – Cory Koch Jul 10 '19 at 20:04
  • 3
    This issue was KILLING me, great answer and explanation. Helped me figure out that my web.config on my QA server did not work with `hostingModel="OutOfProcess"` so I changed to OutOfProcess. Meanwhile my TEST and PROD servers work with InProcess. – EspressoBeans Feb 03 '20 at 17:36
  • My azure app service worked perfectly with this change only ```OutOfProcess``` – kord Feb 24 '20 at 03:34
  • 1
    Beware that you almost certainly will want to use InProcess hosting because it provides better performance and is generally less resource intensive for applications that are deployed to IIS https://weblog.west-wind.com/posts/2019/Mar/16/ASPNET-Core-Hosting-on-IIS-with-ASPNET-Core-22 – erhan355 Jun 09 '20 at 02:00
  • In my case, I was deploying to AWS Elastic Beanstalk. In addition to this, I also had to change the 'Target Platform' to x64 and bam! It worked. – Ravi Kiran Jul 19 '20 at 16:06
  • 2
    The fix for me was actually just adding the line of AspNetCoreModule. I did not need to add the AspNetCoreHostingModel part. I'm using .NET Core 3.1 on VS 2019 – zpert Jul 20 '20 at 22:03
  • installing hosting bundle didn't worked for me but changing proj file did – Aditya Pewekar Aug 19 '20 at 14:09
  • I have a similar issue and the link to the GitHub is dead. I suspect that I have a nuget referencing 2.2 somewhere but I can't seem to track it down. [Question here](https://stackoverflow.com/questions/64994567/http-error-500-30-ancm-in-process-start-failure-on-a-localhost-net-core-3-1-1) – Slagmoth Nov 25 '20 at 01:00
  • @zpert Yeap, adding the lines to my `Asp Core 3.1` app worked. – Pierre Dec 04 '20 at 13:10
  • Changing to AspNetCoreModule (instead of AspNetCoreModuleV2) fixed it for me (didn't need to change from InProcess to OutOfProcess). I just wish the error message was more explicit: "AspNetCoreModuleV2 doesn't exist" would have put me straight away on the right path. – Alex Sanséau Jul 19 '21 at 22:10
98

From ASP.NET Core 3.0+ and visual studio 19 version 16.3+ You will find section in project .csproj file are like below-

  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>

There is no AspNetCoreHostingModel property there. You will find Hosting model selection in the properties of the project. Right-click the project name in the solution explorer. Click properties.

enter image description here

Click the Debug menu.

enter image description here

enter image description here

Scroll down to find the Hosting Model option.

enter image description here

Select Out of Process.

enter image description here

Save the project and run IIS Express.

UPDATE For Server Deployment:

When you publish your application in the server there is a web config file like below:

enter image description here

change value of 'hostingModel' from 'inprocess' to 'outofprocess' like below:

enter image description here

From Several Comments, I have learnt that 'Out Of Process' is worked for them instead of 'Default (In Process)'.

Coder Absolute
  • 5,417
  • 5
  • 26
  • 41
Mohammad Sadiqur Rahman
  • 5,379
  • 7
  • 31
  • 45
  • 10
    After I publish into the serve I change value of 'hostingModel' from 'inprocess' to 'outofprocess' as you said, but I am getting this error now: HTTP Error 502.5 - ANCM Out-Of-Process Startup Failure – wakiwiki Sep 07 '20 at 19:37
  • Is it ok before changing the value of it? – Mohammad Sadiqur Rahman Sep 09 '20 at 04:08
  • No, it is not ok, but it solved by installing Hosting Bundle – wakiwiki Sep 09 '20 at 09:08
  • 1
    How can you do this if there is no web.config file – MyDaftQuestions Nov 30 '20 at 11:28
  • @MohammadSadiqurRahman this worked for me. but changing outofprocess to OutOfProcess might help. Thanks for saving my day :) – Ninja Dec 18 '20 at 02:31
  • @waki68 try OutOfProcess instead of outofprocess – Ninja Dec 18 '20 at 02:33
  • 3
    Dude, you made my day! – Simon Restrepo Feb 24 '21 at 20:30
  • This works. Besides this, please check permissions, add ISS user, creator user in security tab. Also make sure to install asp.net hosting bundle for 5.1 / 3.1 – Max Oct 05 '21 at 16:13
  • Also to confirm that this works... don't know why i've published in dev and pre environment and without this change worked well, and on Production puffff not working after gaining more white hairs tried this change and it worked well! – sir_ask Mar 30 '22 at 20:17
  • Thanks, It saves my day. After simple publish just change. hostingModel="OutOfProcess". will solve the issue. – Vipan May 10 '22 at 07:01
46

In my case I had recently changed a database connection string in my appstettings.json file. Without logging or error catching in place I suspect this error wound up causing the "HTTP Error 500.30 - ANCM In-Process Start Failure" error.

I happened to notice the exchange between x-freestyler and Tahir Khalid where Tahir suggested an IOC problem in startup. Since my startup had not changed recently but my appstettings.json had - I determined that the connection string in my appstettings.json was the cause of the problem. I corrected an incorrect connection string and the problem was solved. Thanks to the whole community.

S.Mann
  • 461
  • 4
  • 3
  • 9
    Thanks for sharing. I checked my appsettings.json and found a mistype. That solved the problem. – heringer Jul 30 '19 at 14:03
  • Similarly; I got the "HTTP Error 500.30 - ANCM In-Process Start Failure" message when my appsettings.json file had a missing '{' – JTech Feb 05 '20 at 01:34
  • 4
    Thanks, in my appsettings.json in the connection string I missed to escape "\" by "\\" in a local sqlexpress connection string. So before the fix i have "Server=machine01\SQLEXPRESS;xxxx" and now with "Server=machine01\\SQLEXPRESS;xxxx" it's running perfectly ! – bau Feb 18 '20 at 11:38
  • I honestly hadn't noticed my issue until looking at the system `Event Logs` that indicated a malformed JSON setting. – vandsh Apr 02 '20 at 20:28
  • Similar to what @heringer experienced, i had an invalid character in my connection string. Removing it solved the problem. – Alexander Santos May 14 '20 at 13:10
  • I was on a feature branch and changed my production connection string to "xxxx" just to be super sure I didn't do anything dopey. Then 2 weeks later I forgot I had done that. This has really saved my back side. What ever happened to "Could not establish a connection to the database" ?!?!? – DJA Oct 18 '20 at 11:46
  • For me, I was updating the database in two different places but at the same time, I deleted the "SeedData" script that was running migrations and it worked like a charm, I guess the error logs are there for a reason, just wish they were more informative! :) – Katherine Oct 21 '20 at 14:39
  • I had firewall settings on my database that did not allow public connections. This helped me troubleshoot the issue and resolve it - Thanks! – Marius Van Der Berg Jan 19 '21 at 11:05
  • Mine issue was that I'm using azure IAM for database access and the new App didn't have permission – Fabio Pinto Oct 19 '22 at 13:26
28

HTTP Error 500.30 – ANCM In-Process Start Failure” is moreover a generic error. To know more information about the error

Go to Azure Portal > your App Service > under development tools open console. We can run the application through this console and thus visualize the real error that is causing our application not to load.

For that put, the name of our project followed by “.exe” and press the enter key.

Amir Touitou
  • 3,141
  • 1
  • 35
  • 31
  • 2
    This is definitely the right starting point. My issues had nothing to do with IIS and your answer helped me figure out the underlaying cause. Thanks a lot. – GETah Mar 21 '21 at 04:26
  • 2
    This answer is relevant for AZURE. It was the perfect answer for me. Thank you! – Vilhelm H. May 19 '21 at 11:59
  • 1
    This is the correct answer for Azure! I actually got the applicable exception message via the console. If you are not sure what the name of your .exe file is, build a release version of your app locally and look in this folder: bin\Release\netcoreapp3.1 – Brendan Sluke Sep 30 '21 at 02:06
  • 1
    Love your approach, I had the same feelings but never new I could run the exe. Thanks I figured the issue was in startup – Sahib Khan Dec 15 '21 at 22:06
27

I got the same error on my development machine running Windows 10. The error did not go away after I installed dotnet core hosting bundle. I had to go to Event Viewer to get the detailed error. Your underlying issue (if any) may be different than mine. Point is, if you're on a Windows machine, Event Viewer is there to provide details. Hope this helps someone.

event viewer provided error details

joym8
  • 4,014
  • 3
  • 50
  • 93
19

If you are using Visual Studio, and have any instances of it running, close them all.

You should find a .vs sub folder where your Visual Studio solution (.sln file) resides.
Delete the .vs folder and try again with the in-process hosting model.

Henke
  • 4,445
  • 3
  • 31
  • 44
Qamar Zaman
  • 2,521
  • 2
  • 10
  • 16
  • Remember that .vs folder may not be visible in File Explorer by default. To open it just type in the folder name in the path of File Explorer. In my case I had just delete all the files from that directory – Andrey Tagaew Jan 27 '21 at 16:35
  • @AndreyTagaew, You can check show hidden files option from Folder Options to see hidden files or folders. – Qamar Zaman Mar 25 '21 at 16:46
14

ASP.NET Core 2.2 or later: For a 64-bit (x64) self-contained deployment that uses the in-process hosting model, disable the app pool for 32-bit (x86) processes.

In the Actions sidebar of IIS Manager > Application Pools, select Set Application Pool Defaults or Advanced Settings. Locate Enable 32-Bit Applications and set the value to False.

Source: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-3.0#create-the-iis-site

DimaSUN
  • 921
  • 8
  • 13
5

I looked at the Windows Logs under Application. It displayed the error message and stack trace. I found out I was missing a folder called node_modules. I created that folder and that fixed it.

I did not make any changes to web.config or the project file. My .NETCoreApp version was 3.1

Carmela P
  • 51
  • 1
  • 1
4

Removing the AspNetCoreHostingModel line in .cproj file worked for me. There wasn't such line in another project of mine which was working fine.

<PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
</PropertyGroup>
HasanG
  • 12,734
  • 29
  • 100
  • 154
  • 3
    I don't like removing things to resolve an issue as it masks what the actual issue was but thank you x-freestyler for this post as by removing that line it exposed the underlying issue which was to do with an IoC startup failure for one of the dependencies not being registered! – Trevor Apr 07 '19 at 18:26
4

In may case it was just a typo which corrupts and prevents parsing of JSON settings file

Ozan BAYRAM
  • 2,780
  • 1
  • 28
  • 35
3

Mine is because of UseKestrel() in program.cs It should be .ConfigureKestrel() in 2.2

more info at https://learn.microsoft.com/en-us/aspnet/core/migration/21-to-22?view=aspnetcore-2.2&tabs=visual-studio&WT.mc_id=-blog-scottha#update-kestrel-configuration

maxisam
  • 21,975
  • 9
  • 75
  • 84
3

I found another issue that starts out giving the same error message as in the question. I am sharing this here so that before changing the project file you can make sure your services are properly registered.

I am also running .netcore 2.2 and was receiving the same error message so I changed project file from InProcess to OutOfProcess as in the selected answer. After that I found the real cause for my issue when I received “Cannot instantiate implementation type” : The cause of this was for me was having:

services.AddScoped<IMyService, IMyService>();

instead of

services.AddScoped<IMyService, MyService>();

Related post: Why am I getting the error "Cannot instantiate implementation type" for my generic service?

Cory Koch
  • 470
  • 4
  • 8
3

I had a similar issue when attempting to switch to from OutOfProcess hosting to InProcess hosting on a .Net Core project which I had recently upgraded from 2.0 to 3.0.

With no real helpful error to go on and after spending days trying to resolve this, I eventually found a fix for my case which I thought I'd share in case it is helpful to anyone else struggling with this.

For me, it was caused by a few Microsoft.AspNetCore packages.

After removing all of the referenced Microsoft.AspNetCore packages that had version less than 3.0.0 (there was no upgrade available >= 3.0.0 for these) this error no longer occurred.

These were the packages I removed;

<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.8" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="2.2.1" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />

All other Microsoft.AspNetCore packages with version greater than or equal to 3.0.0 worked fine.

3

Download the .NET Core Hosting Bundle installer using the following link:

Current .NET Core Hosting Bundle installer (direct download)

  1. Run the installer on the IIS server.
  2. Restart the server or execute net stop was /y followed by net start w3svc in a command shell.
vaheeds
  • 2,594
  • 4
  • 26
  • 36
3

moreover a generic error. To know more information about the error Go to Azure Portal > your App Service > under development tools open console. We can run the application through this console and thus visualize the real error that is causing our application not to load. For that put, the name of our project followed by “.exe” and press the enter key.

https://learn.microsoft.com/en-us/answers/questions/38950/http-error-50030-ancm-in-process-start-failure.html

2

This publish profile setting fixed for me:

Configure Publish Profile -> Settings -> Site Extensions Options ->

  • [x] Install ASP.NET Core Site Extension.
ttugates
  • 5,818
  • 3
  • 44
  • 54
2

After spending an entire day fighting with myself on deciding to host my asp.net core application on IIS with InProcess hosting, i am finally proud and relieved to have this solved. Hours of repeatedly going through the same forums, blogs and SO questions which tried their best to solve the problem, i was still stuck after following all the above mentioned approaches. Now here i will describe my experience of solving it.

Step 1: Create a website in IIS

Step 2: Make sure the AppPool for the website has .Net CLR version set to "No Managed Code" and "Enable 32-bit Applications" property in AppPool -> Advanced Settings is set to false

Step 3: Make sure your project is referencing .Net core 2.2

Step 4: Add the following line in your startup.cs file inside ConfigureServices method

services.Configure<IISServerOptions>(options =>
{
     options.AutomaticAuthentication = false;
});

Step 6: Add the following Nuget packages

Microsoft.AspNetCore.App v2.2.5 or greater

Microsoft.AspNetCore.Server.IIS v2.2.2 or greater

Step 7: Add following line to your .csproj file

<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>

Step 8: Build and publish your code (preferably x64 bitness)

Step 9: Make sure you added your website hostname in etc/hosts file

Step 10: Restart World Wide Web Publishing Service

Now test your asp.net core application and it should be hosted using InProcess hosting In order to verify whether your app is hosted using InProcess mode, check the response headers and it should contain the following line

Server: Microsoft-IIS/10.0 (IIS version could be any depeding on your system)

Update: Download and Install ASP.Net Core Hosting Bundle which is required for it to work

Community
  • 1
  • 1
mdowes
  • 592
  • 7
  • 18
2

In my case it was a wrong value in appsettings.json file. The value was .\SQLEXPRESS and it worked after i changed it to .\\SQLEXPRESS

Moha med
  • 89
  • 8
1

Resolved my issue by running dedicated App Pool for AspNetCoreModuleV2

Description:

HTTP Error 500.34 - ANCM Mixed Hosting Models Not Supported

I was running multiple applications under the same App Pool. Some of the applications were running

<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />

The application causing the error was running AspNetCoreModuleV2

<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />

I created a new App Pool dedicated for AspNetCoreModuleV2 and it resolved my issue.

BDarley
  • 697
  • 1
  • 10
  • 19
1

I encountered this issue on an Azure App Service when upgrading from 2.2 to 3.1. The reason ended up being the "ASP.NET Core 2.2 (x86) Runtime" Extension was installed on the App Service. Removing that extension from Kudu fixed the issue!

Saeb Amini
  • 23,054
  • 9
  • 78
  • 76
1

Wow, there are a lot of answers on this question, but I had this same issue and my solution was different from anything I read here, and also quite simple.

I had been having issues with deploying my app to azure with the right environment settings, so I was messing with the launchsettings.json file, and I had changed the value of the ASPNETCORE_ENVIRONMENT variable in the IIS profile from "Development" to "Production". Changing it back to "Development" fixed the issue for me.

  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
Daniel Ecker
  • 105
  • 13
1

Make sure that your *.deps.js json file copied correctly to the deployed location

1

In my case it was database connection problem. This error needs to be more clear. I hope they will do it in the future. Basically it is a problem at ConfigureServices function in Startup. My advise is try to add all lines try catch in ConfigureServices function and you can findout where is problem.

cbalakus
  • 620
  • 7
  • 15
1

In my case after spending a lots of time the problem was the platform target was x86 and after change it to any CPU the issue fixed. platform target

Anas Jaber
  • 583
  • 1
  • 7
  • 20
1

This error was blowing my mind. I tried all the things.

The magic happened when I deleted the published site from IIS, deleted the Application pool and created all over again. After that, It worked on the first request.

I don't know If I had broken some configuration before, but setting up the ISS site again worked.

Allan Zeidler
  • 317
  • 2
  • 7
0

For me it was wrongly injected DBContext in HostedService. I rewrote it according to this:

How should I inject a DbContext instance into an IHostedService?

and all worked fine!

Michael Snytko
  • 327
  • 3
  • 13
0

Because the application crashes. For whom saving time on this exception!

And the error code says it throws an exception because it can't find a file in the initial phase. See the Environment Settings section. In my scenario, it worked when I changed the following code

var environment = whb.GetSetting("environment");

to

var environment = "Development";// whb.GetSetting("environment");

Because I have appsettings.development.json but I didn't have appsettings.production.json. Why it can't find any file because it's looking for different thing on right place.

Hamit YILDIRIM
  • 4,224
  • 1
  • 32
  • 35
0

With .Net Core 2.2 you should be able to use the InProcess hosting model, since it is naturally faster: everything is processed in IIS, without an extra HTTP-hop between IIS and your app's Kestrel server. One thing you might want to do is add this tag: AspNetCoreModuleV2 Notice the new AspNetCoreModuleV2 vs older AspNetCoreModule option. Another important thing to do is, examine Windows Application Event Log, to identify the culprit. Although error messages there may be cryptic, occasionally, they point to the exact line numbers in the code that caused the failure. Also, in case you use CI/CD with TFS, there maybe environment variables in appsettings.json file that were not properly replaced with their designated values, and this was one of the exception sources for me.

Mike O.
  • 61
  • 6
0

I had an issue in my Program.cs file. I was trying to connect with AddAzureKeyVault that had been deleted long time ago.

Conclusion:

This error could come to due to any silly error in the application. Debug step by step your application startup process.
TheKingPinMirza
  • 7,924
  • 6
  • 51
  • 81
0

In my case, I had a migration which was failing when run on a specific environment in Azure, but running fine in dev. As we have the service configured to run the migrations as part of startup, the actual startup of the web app fails.

I ran the migration manually on the environment to discover the problem, then adjusted it to deal with the data differences on that environment.

If anyone knows how I could have seen the migration error without manually running in directly on the DB, that would be useful.

TheLogicMan
  • 371
  • 4
  • 12
0

I just had the same the same issue. It turned out it was a stupid mistake on my side.

In the ServiceCollection I tried to register an abstract class

services.AddScoped<IMyInterface, MyClasss>();

where MyClass was abstract for some unknown for me reason hehe :)

So guys if you got HTTP Error 500.30 - ANCM In-Process Start Failure Just review your ServiceCollection

Dzhambazov
  • 490
  • 2
  • 11
0

For me, everything was just fine but the issue was due to publishing by different VS versions, weird !!! (latest VS 2019 (16.4.2)). When I publish the application with VS 2017 it works fine.

The actual issue is in its dependency json file (e.g. MyWebApp.deps.json) in the publish folder. Hope it helps someone.

enter image description here

Premchandra Singh
  • 14,156
  • 4
  • 31
  • 37
  • Lately, I find out that the file is available in the published folder. But error message in the evenLogs is pointing to this dep.json file and in this JSON file path mentioned is `runtimes/win-x64/native`, not sure this is pointing to the same folder or in some path – Premchandra Singh Dec 21 '19 at 05:28
  • The actual issue I have on evenlog is `Could not find inprocess request handler. Captured output from invoking hostfxr: Error: An assembly specified in the application dependencies manifest (Cues.Web.deps.json) was not found: package: 'runtime.win-x64.Microsoft.NETCore.App', version: '2.2.8' path: 'runtimes/win-x64/native/mscordaccore_amd64_amd64_4.6.28207.03.dll' ` – Premchandra Singh Dec 21 '19 at 06:46
0

Plz see my prev answer in this same thread to understand the whole. Sorry for multiple answers

After further investigation, the issue was happening due to VS 2019 picks the latest patch(default behavior of VS) of .net core 2.2 which is 2.2.8 for me to publish the application. We can restrict this to a specific version of choice by using

<RuntimeFrameworkVersion>2.2.4</RuntimeFrameworkVersion>

See Here. This finally solved my issue even though the latest patch is not applied. I can build from any VS 2017 or VS 2019, both publish the application for .net core 2.2.0 runtime version

enter image description here

Premchandra Singh
  • 14,156
  • 4
  • 31
  • 37
0

I had the same error and the issue was with Microsoft.Extension.Primitives version of the package was not compatible with the .net core version. And this was referencing from one of the projects references from my project was referencing.

Once I had changed the Microsoft.Extension.Primitives in that project. This issue got fixed.

In the Azure event logs, check what error you are getting and if it is related to a package reference. Try the above thing that I have mentioned.

Since nuget packages are tightly coupled with the .net version. Just have to make sure all packages referencing to the project should also be tightly coupled with the .net version.

Kiran
  • 21
  • 2
0

Well for me I had a complicated app startup in which I had created my own WebHostBuilder. This worked fine but failed when I tried the InProcess hosting mode. I assume there was something I missed calling in WebHostBuilder. So I made sure I always call WebHost.CreateDefaultBuilder(args), then make any extra changes - basically as the new app templates do.

Or for asp core 3.1 templates which use IHostBuilder (not IWebHostBuilder), call ConfigureWebHostDefaults

 public static IHostBuilder CreateHostBuilder(string[] args) =>
        Host.CreateDefaultBuilder(args)
            .ConfigureWebHostDefaults(webBuilder =>
            {
                // add stuff here
                webBuilder.UseStartup<Startup>();
            });
bmiller
  • 1,454
  • 1
  • 14
  • 14
0

In my case, non of above solution worked. But when I removed myproject.vspscc file from solution explorer, the problem solved.

SalmanShariati
  • 3,873
  • 4
  • 27
  • 46
0

I had a runtime error in Startup.cs. Schoolboy error - I made a small tweak to that file, but didn't run my app locally before deploying to Azure. The app didn't startup successfully and I got the 500.30 error page.

Fijjit
  • 1,399
  • 2
  • 17
  • 31
  • I also had an issue in the Startup class. I was using EF _in memory_ database and trying to seed it on the **main** method. It works when running locally, but not in Azure. – Yuri Cardoso Mar 15 '20 at 03:25
0

I have encounter issue with .net core 3.1. I have tried all the solution but did't work for me. Then I looked into IIS Log . The issue was Application unable to make connection with database because coonection string was invalid. So Please Look into IIS log to find the issue It may be any exception comes at runtime

Muhammad Aqib
  • 709
  • 7
  • 14
0

Issue with development server

In my case it was due to SDK version.
I have installed all latest updates of VS 2019 but it was not enough.
Error happened when I tried to start web application with VS development server (IISExpress/Kestrel).

So to fix that I just downloaded and installed latest dotNetCore SDK.
For that moment it was version 3.1.2.
And problem is solved!

Maxim
  • 13,029
  • 6
  • 30
  • 45
0

I Had the same problem that made because I did this in Startup.cs class and ConfigureServices method:

services.AddScoped<IExamle, Examle>();

But you have to write your Interface in the first and your Class in the second

SReza S
  • 151
  • 1
  • 9
0

I got this problem when my Azure service was immediately trying to get a secret from Azure KeyVault and I had forgotten to give the service permission by KeyVault.

bytedev
  • 8,252
  • 4
  • 48
  • 56
  • H, refer the following article. It will be helpful to solve the problem. https://medium.com/@aravindi.s.amarasinghe/configure-azure-key-vault-with-net-core-project-and-deploy-to-azure-app-service-7616303181e – Aravindi Amarasinghe Sep 21 '21 at 12:04
0

Just in case this helps anyone that may have made the same mistake I did.

My website has a SSL certificate by Certify the Web.

When I published, I deleted the _Well-Known folder and this error came up.

enter image description here

Had I not emptied my recycle bin 30 seconds before I figured this out on my virtual machine, I could have just restored the folder.

Instead, I re-requested my certificate, restarted that site and the issue was resolved.

0

I have met this problem because I edit the Program.cs and I delete the Run function. Just add it again:

enter image description here

Lê Văn Hiếu
  • 171
  • 1
  • 6
0

All i'm going to say in this answer is make sure you uh... don't have anything similar to this in your service registration code..

        while (!Debugger.IsAttached) {
            Thread.Sleep(500);
        }

This totally did not happen to me and definitely did not make me a very sad boy after 3 hours of screwing around with all of the above answers and more.

Charles
  • 405
  • 4
  • 13
0

For us, it was after install EF 5 on an existing core project.

On the PC of my colleague, after a publish, he was having this DLL file : mscordaccore_amd64_amd64_4.700.20.20201.dll

And me, this one :
mscordaccore_amd64_amd64_4.700.20.36602.dll

After his publish to release, the website returned the HTTP Error 500.30.

After my own publish to release, the website was working fine.

Portekoi
  • 1,087
  • 2
  • 22
  • 44
0

it's exception in the setup or missing library or file dependency if you are on azure go to App Service Diagnostics then logs and you will get the issue

i was having same issue in my asp 3.1 core , the error was missing a json dependency file so i had to add it to wwwroot/ExternalDependencies in azure

Abdullah Tahan
  • 1,963
  • 17
  • 28
0

When hosting in Amazon Web Services (AWS) using an Elastic Beanstalk (EBS) deployment AND using this stackoverflow answer on how to access configuration values in EBS containers (https://stackoverflow.com/a/47648283/78804)

If NO configuration values have been set within the Elastic Beanstalk -> Environments -> [APP NAME] -> Configuration -> Software menu, you will probably see this error.

Setting ANY SINGLE VALUE in the EBS config, makes it go away.

This is probably caused by the configuration-loading block failing to do a null check and the entire website failing un-gracefully because the error is happening during the application Startup phase.

Alex C
  • 16,624
  • 18
  • 66
  • 98
0

In my case I forgot to add one comma (,) between two lines in the appsetting.json file. I have added the comma, after that it works.

Saroj Jena
  • 37
  • 1
  • 4
  • Same thing for me except that i didn't escape some backslashes in the appsettings.json file. I'm on Windows so the event viewer helped me to spot the error. – 0xTheOldOne Mar 07 '23 at 10:39
0

I was able to get the site working InProcess by setting "Enable 32-Bit Application" as False for the application pool for the respective net core site app pool.

Harshal
  • 105
  • 4
0

I was encountering this error when trying to deploy (.NET Core 3.1/Angular app) to Azure App Service via Visual Studio publish. The issue ended up being old files on the server not being deleted properly post publish.

To fix:

  1. Click Edit on the publish profile
  2. Settings tab > Expand File Publish Options > Check "Remove additional files at destination"
  3. Republish

Credit: https://build5nines.com/fix-net-core-http-error-500-30-after-publish-to-app-service-from-visual-studio/

Milo
  • 3,365
  • 9
  • 30
  • 44
0

In Visual Studio I was incorrectly running debug mode as "IISExpress", I changed to my profile, and now everything works

tfa
  • 1,643
  • 16
  • 18
0

If you got this error after configuring the Azure Key Vault with the .NET Core application, please refer the following article. It will definitely help you to fix it. https://medium.com/@aravindi.s.amarasinghe/configure-azure-key-vault-with-net-core-project-and-deploy-to-azure-app-service-7616303181e

0

just check windows event log for view the clear error

hossein andarkhora
  • 740
  • 10
  • 23
0

for me issue was that old project in .net core 3.1 loaded in vs 2022 SOMEHOW added to webconfig environmentVariables

      <environmentVariable name="ASPNETCORE_HOSTINGSTARTUPASSEMBLIES" value="Microsoft.AspNetCore.Watch.BrowserRefresh;Microsoft.WebTools.BrowserLink.Net" />
      <environmentVariable name="DOTNET_STARTUP_HOOKS" value="C:\Program Files\dotnet\SDK\7.0.201\DotnetTools\dotnet-watch\7.0.201-servicing.23116.14\tools\net7.0\any\middleware\Microsoft.AspNetCore.Watch.BrowserRefresh.dll;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions\Microsoft\Web Tools\Browser Link\Microsoft.WebTools.BrowserLink.Net.dll" />
      <environmentVariable name="ASPNETCORE_AUTO_RELOAD_WS_ENDPOINT" value="wss://localhost:44345/ApiDotNetCore/,ws://localhost:64285/ApiDotNetCore/" />
      <environmentVariable name="DOTNET_MODIFIABLE_ASSEMBLIES" value="debug" />
      <environmentVariable name="ASPNETCORE_AUTO_RELOAD_WS_KEY" value="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7s+b3aeCFt3VjmXgwX73r2K4vZ1hWvXkXqEdG8hjDvdNkqJx6fQbOcfZ91tOTh54Q4Bm4rm6Cc4qe3stRZRdJ0+pUpcA7K1gzarHjcfTPx4frIwfIFlQF9FmH4O5SA+OC5QYXAgqwXcHukYXZAA6LMdRDceeQBy8Y0JyTgKePo3ZyjkSByDgTmfIc+jObBuvaDoxjOv+GyD84VeNsw4O1bvo1NQ9tlTObDeQIDAQAB" />
      <environmentVariable name="ASPNETCORE_AUTO_RELOAD_VDIR" value="/" />

after removing thease and keeping just

      <environmentVariable name="COMPLUS_ForceENC" value="1" />
      <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Production" />

as it was sometimes ago - it works fine !!

hope this helps someone regards

d00lar
  • 802
  • 7
  • 25