Problem to deploy a netcore Web Api in Windows Server IIS - iis

I'm strugguling to deploy a netcore 3.1 web api in an IIS inside a windows Server, I already tried a lot of tutorials that give some steps like this one https://codingsonata.com/deploy-asp-net-core-web-api-on-iis/ , but I'm always getting a error.
Now that is what I see:
Does anyone knows what I could try to fix it? I already tried a lot of things, change things in the webconfig, I activated everything in the Windows features but I always get this. I already spent a lot of time on it and without success. :/

Related

Blazor publish integrity issue

My team is currently working on a new Blazor app and we are facing some strange behavior. We deploy our APP using Azure Dev Ops, but it seems that sometimes things go wrong. If we deploy the same version with the the same pipeline, the issue could be solved...
This is the error we (sometimes) get in every browser chrome, firefox, edge, ...:
admin:1 Failed to find a valid digest in the 'integrity' attribute for resource 'https://domain/_framework/dotnet.timezones.blat' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
This seems to be happening completely random. We have tried everything... like disabling compression, checking IIS settings, clearing cache, ... We also read the complete Microsoft Documentation. Some other guys also had this problem and they have a solution by clearing the obj/ folder. But we never have this issue locally... So this isn't a solution for us.
Does anybody have any idea what could be the problem? Because it seems completely random to us so far.
The app is ASP.NET core hosted and not stand-alone.
Any help would be very much appreciated!
Kind regards,
Evert
I just ran into the exact same problem. My VS solution compiled and ran under VS 2022 no problem. But when I published to my dev or prod web server I got the same message that you encountered. I solved it by clearing the bin, obj, and .config folders in all my projects in the solution. You mentioned that you don't have the problem locally -- neither did I and this still resolved the issue when I deployed. I suspect an older version of a file is getting into the deployment pipeline somewhere. Mine is also a hosted solution under .NET 6.0.2.

System.TypeLoadException on Azure App Service

I'm running an asp.net 4.6 app on the app service. Just removed mvc from the site and using url rewrite to run an mvc free angular spa with a webapi.
Now it's asking for a type that was renamed months ago and works in pre mvc removal builds. I don't think it's got something to do with mvc though.
In trying to solve this I've xeroxed my local bin folder onto the server and the error still persists. So some sort of server config?
Has anyone ever experienced this before?
The error means that you are using a type which is not found in your assembly. To troubleshoot this issue, you need to find where you used this type. I suggest you use the Find in files feature provided by Visual Studio by pressing Ctrl+Shift+F. After found the place which used the type, you just need to delete it and rebuild your application.

Azure web app not working - 500

I really want to use dotnet core and azure. I used the amazing yeoman aspnet generator to scaffold out a basic app. This ran fine locally using Kestrel.
I then added the app to my github account and linked this to a new Azure Web App instance to deploy the thing. But no joy :( I get a 500 error.
Looking at the setting of the webapp it saying using .net framework 4.6 is that right or am I missing something, cannot see an option for .net core 1.0 that I expected to see??
I tried turning on logging in the setting with detailed exceptions etc but have not found anything to give me a clue as to what going on.
#Andy, Could you try access into kudu site(yoursite.scm.azurewebsites.net) and start web.cmd file in this folder (/home/site/approot)? I suggest you can try to start this command. Meanwhile, please refer to Shawn's blog 'https://wildermuth.com/2016/04/29/Deploying-ASP-NET-Core-RC1-to-Azure-App-Services '. Any information or update, please let me know.

IISNode running Node.js with multiple domains issue

I put a basic, no frills node npm-express blog site up on a azure website and the IIS load balancing or just iisnode itself seemed to cause issues running the app.js. Running outside of IIS didn't experience any issues. No websockets, just express using vash templates.
The issues I ran into are:
Using web deploy and some node_modules intermittently not deploying. npm lwip for instance would work at first then wouldn't if deploying again. Sometimes other js and vash files would not update also.
When using the site there was a plain vash templates section (the public facing side) and a login side of the site. The simple one page public facing side would intermittently create a 500 error. One out of every three request would do this. No logs generated and all logging was turned on. The error was from iisnode and not node itself.
Using visual studio 13 with all the latest updates, remote debugging simply didn't work. Basically in the dark. Oddly the logged in portion using npm-passport-local worked but that never changed domains when using. It was only the pages on the public side that this would happen. FYI, the public side had multiple domains and various sub domains pointing to the site. All entered correctly in the azure portal and would work with the intermittent 500 error. The page had links to other blogs with full urls, hence the domain would change. Which should be an issue but I suspect had something to do with it.
I ended up having to create a azure vm and install node on it myself to get the site working without the use of IIS. FYI, running the node site locally on my sand I never encountered any issues either.
Has anyone else experienced issues like this using iisnode and did you find a work around for this?
I suspect it may happen when multiple domains are used for the same instance.

.NET 3.5 Service Pack 1 causes 404 pages on ASP.NET Web App

I have a problem with IIS 6.0 ceasing to work for an ASP.NET application after installing Service Pack 1 for .NET 3.5.
I have 2 identical virtual dedicated servers. Installing SP1 on the first had no adverse effect. Installing it on the second caused ASP.NET pages to start returning 404 page not found.
Static .html pages working okay on both servers.
Has anybody else experienced this?
This is broad problem, so let's start by asking some troubleshooting questions:
Based on your description, the ASP.NET runtime is not catching your request and processing the aspx files. You may need to register the asp.net pipeline with IIS again using ASPNET_REGIIS -i.
Have you made sure that the app_offline.htm file has been removed
from the directory of the application?
I have had this happen before after an
update.
Have you setup fiddler for instance to follow the request to see what is
exactly being requested?
Make sure ASP.NET is enabled in the IIS Administration Console under "Web
Service Extensions." Make sure everything is set to allowed for your different versions of the framework.
Well, let's start with those and hopefully we can guide you to the problem.
I've seen various people with this problem recently. This link might help.
And this one.
And a few others.
Is CustomErrors in your web.config set to On or RemoteOnly? If so, what do you get when you change it to Off?
I have not had this exact error with .NET 3.5 SP1, but have seen similar occur in the past. Typically it can be resolved by opening a command prompt, going to the appropriate .NET folder and running ASPNET_REGIIS -i. In the case of .NET 3.5 there wasn't an update to the main bits of the framework, so you'd actually go to the .NET 2.0 folder, which on my machine can be found at:
\Windows\Microsoft.Net\framework\v2.0.50727
Running the ASPNET_REGIIS -i will re-register all the ASP.NET libraries with IIS, and should be the equivalent of a re-install of the framework on a given machine (as far as IIS is concerned)
Just to clarify. The last (4th) point given by Dale was the problem. During the installation of SP1 the Status for ASP.NET and WebDAV became set to Prohibited under Web Service Extensions.
Why the installation of SP1 changed this setting on one server and not the other is a mystery that I wouldn't mind (but not expect) an answer to...
The second link provided by CodingTheWheel also had the answer so I'm also going to mark this as an answer.
No-one did before, so I'll point to the trivial solution:
Have you already de-installed the Service Pack and re-installed it again (or the whole framework)?
Edit: #Kev:
Easy explanation: He said the update works on one machine, but not on the other. I had similar problems in the past and re-installing helped to solve some of them. And it is trivial to do.
That's my approach:
1. trivial
2. easy
3. headache
You are right, on productive systems you must be careful, but that's his decision. And because it is a virtual server, maybe it is easy for him to copy it and try as a test environment first.

Resources