i have
serverside blazor project (website)
web API made with entity framework core
both target 3.1. and as selfcontained projects.
my API routes are xxxxxx.com/api/*
i'm using unoeuro so dont have full control over the IIS as i understand it.
i can convert to applications, so i tried making a API folder and turn it into an application. But i guess there is something i need to change. Because when deploy the API it works, but then when i deploy the website the API stops working and gives me.
HTTP Error 500.0 - ANCM In-Process Handler Load Failure
Common causes of this issue:
The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found.
So is there a file i need to specify this setup in.
What i had to do was, run my api as a outofprocess application.
<PropertyGroup>
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
</PropertyGroup>
and change my AspNetCoreModuleV2 to AspNetCoreModule in web.config
Related
I inherited a project that is a collection of WCF Services that target .Net Framework 4.6.1. I wrote a front end SPA application that targets .Net Core 2.2 not realizing that the hosting model was such that both the UI (.Net Core) and the API (.Net 4.6.1) need to run under one Site on IIS.
I'm trying to get this to work on my local machine. I created a new Site in IIS -- Site A. I published my .Net Core application to Site A and set it up with an application pool set to "No Manged Code".
I then added an Application to Site A called API and added all my WCF services in that folder. I configured API to use an application pool that targets ".NET CLR 4.0".
I updated the web.config in the root of Site A to include all the necessary bits for WCF.
I'm able to hit Site A and get my SPA UI, but when I do anything that attempts to hit the backend API (including trying to hit it directly -- http://localhost:464646/api/test.svc), I get the following error:
HTTP Error 502.5 - ANCM Out-Of-Process Startup Failure
Is what I'm doing even possible? If so, what changes do I need to make in order to get this to work?
I am trying to get my code to run alongside, in process, with an asp core web site.
With .net framework there is an option to create a module. Then, in order to "inject" that module so that it is run when the site runs all I need to do is add the module to web.config or launch it from a .cs file from \app_code.
With asp core, there is a concept called middleware but in order to add a middleware, the user has to write it into their startup code.
I need a way to run my .net core code when the site has started (first page accessed) without requiring the user to change their code to do so. Changing config files after deploy is OK but not compiled files.
Anyone know how to do this?
Thanks.
I see 2 options here:
Hosting startup assemblies
An IHostingStartup (hosting startup) implementation adds enhancements
to an app at startup from an external assembly. For example, an
external library can use a hosting startup implementation to provide
additional configuration providers or services to an app.
IIS modules with ASP.NET Core - you may still be able to inject your module in case you run the app on IIS. Add a web.config manually into the root directory and configure your module in there.
I created a project using blazor then published it and hosted it in hostgator, when I visit the url get the error HTTP 500.0 In-process handler load failure I found some related answers here but all were on Dotnet 2.2 which describing modification to web.config file, Dotnet 3.0.1 doesn't have web.config file instead it's appsetting.json please do I fix this
in my own case now do I have to add the web.config myself, please I need help thanks
Unless they have ASP.NET Core 3.1 hosting in place then they don't support it. Therefore Blazor is TU on that host. From what it looks like that don't have it installed without asking about it from their support once that is done then you will have what you need. My guess is they don't support it.
I have an ASP.NET Core application published to Azure. It contains companion application published using ClickOnce.
When I look at the web server's console, I see all of the necessary ClickOnce files. And I can launch the application using http://mysite.azurewebsites.net/tools/MyApp.application as expected.
But if I click on http://mysite.azurewebsites.net/tools/setup.exe it fails with a 404 error.
I'm assuming that the ASP.NET application is preventing "setup.exe" from being exposed, but I don't know how to alter that configuration.
I've just upgraded an ASP.NET Core 1.1 web application to 2.0 and tested without issue locally. However, when the site is deployed to Azure a POST request that worked locally results in a 404 (I guess this could be the same for all POST requests, but I'm unable to log-in due to the issue).
Any ideas why this might fail to be working when deployed to Azure but working perfectly when run through IIS Express locally?
I deleted the original deployment slot on Azure and re-created as initially deploying over the slot mixed old 1.1 DLL's with the newer 2.0 DLL's and prevented the site working at all.
Seems I was caught out by poor handling of errors by my web application. I'd assumed that app.UseExceptionHandler("/Error") (I default my HomeController to not require the leading "Home" for /Home/Error) in Startup.cs would redirect to an error page, but for me it is not.
My underlying issue was a database connection error that caused the POST controller method to fail. I was caught out by the response returning a 404 rather than an error status.
I will need to investigate how error handling works in more detail for ASP.NET Core it seems.