Four Reasons Why Your ASP.NET Core Application is Not Working in IIS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome to another asp.net core coding tutorial from round the code now today we're going to be looking at four reasons why your asp.net core application might not be working in iis come the end of this video you should be able to resolve any issues that you have with your asp.net core application working in ios now i recommend that you go ahead and subscribe to this channel and also click on the notifications tab by clicking on that you'll get a notification every time we release a video so in front of us we've already got an asp.net core application open in visual studio what we're going to do now is we're basically going to go ahead and publish it to a folder so we go into publish and we've got a target location there and we're going to publish it to that folder now whilst it's doing that we've basically already set up an iis website for this application if we go into basic settings you can see we've set up the physical path which represents the folder that we're publishing to in addition to that as well we've got binding setup for react signal r if we go into our host file you can see that we've already set up an ip address pointing to that particular host so it's just going ahead and finishing up the publishing when it does we're going to test it in iis to see what what exactly happens does it actually work or not so let's go ahead and do that so we can go ahead we can turn on the website in is and if we refresh that we're getting a 519 error there um it cannot read um the file because of permissions it's got some sort of permissions issue as you can see down there so quite easy to resolve that so this is the folder where we're basically hosting our application in iis if we right click on it and we can go to properties so we've got a couple of groups and users in there that have got permissions but we need to add another one so on windows 10 typically if we can find it it's is i users so what you can typically do is just give it full permission and that should hopefully resolve the issue now if you find that that doesn't resolve the issue or that group isn't there then you can also add the users on there and that should also make it work but obviously bear in mind that there might be some sort of security issues if you're given access to all users but you can basically click on the users and that should at least get the thing going but anyways let's go ahead and do that so let's apply those changes and see if it's actually resolved the issue so if we go back give it a refresh okay so we're still getting the 519 error but crucially there's no error there now what could be the reason for that well basically we need to download the asp.net core runtime for it to work not only does it have it for x64 and x86 but also it installs runtime support for iis so you can get that from microsoft's website here and it's basically this down here so runtime 3.7 and it clearly says here on windows we recommend installing the hosting bundle which includes the net core runtime and ias support and so that's basically that here now we've already downloaded this so we're just going to go ahead and install it crucially though we've basically written the application 3.1.7 but we're going to install an asp.net call runtime a slightly lower version we're going to go for version one so we're going to go ahead and install that so that's going ahead and doing that now so once this is installed we'll try it again in iis to see if it's actually resolved the issue or not or whether we might have some issues with the version there we go it successfully completed that so let's go ahead and see what happens so let's go ahead and refresh our application okay so we got a different issue now we've got a 500.21 handler asp.net core has a bad module sp netcore module v2 in its module list okay so obviously that's an issue there where we've got a different version run time to where we've actually the actual version number that we've written our asp.net core application in visual studio so let's go ahead and actually install the right one now so we're going to go ahead and install 3.1.7 so we're going to go ahead and do that so it's just going ahead and doing that so hopefully after that it will resolve the issue all being well so it's gone ahead and done that okay so we've got a different error now we've now got 500.30 error what does that mean exactly well there's no actual issue with is there's an issue with your application so if we go back into our application and try and run it locally to see if we can diagnose what the issue is now you might find that there is no issue running it locally and there's actually an issue on your on your production server as you can see there we've got i've deliberately put in an error there just to sort of demonstrate this but going back to what i was saying you might find that on your production server it might have an issue like it can't see the database so how do we go about resolving that well what we can do is if we go into our folder where we've published we can go down to the web config so we open up the web config and you can see here we've got this asp.net core tag in here and inside here we've got an attribute of std out log enabled and that's currently set to false we've also got this std out log file and that's basically a folder where it can store log files obviously this is turned off by default but we can turn it on and just save that and then we can try and rerun it again so it's still going to throw an error but what we can do is you can see it's created this logs folder up here so if we go in here we can have a look and see what error we're getting so it's saying input string was not in the correct format startup line cs line 39. so if we go back into our visual studio application you can see it's this issue here so we can go ahead and remove that go ahead and republish it before we republish it we just need to turn the site off so it's able to actually overwrite the files so we go ahead and publish that so once this is now we're publishing an application where it's basically shouldn't have any particular issues with it hopefully it will go ahead and work so let's turn it back on in is not quite it's not quite finished yet okay so it's finished publishing now so we can go ahead and turn it back on in is and let's just give it another go just to see if it's going to work there you go you see our application is now working in is and just make sure that the functionality is working because this is actually a react application well it's got an api built in so this is all working for an api and signal r as well it was one of the demonstrations i showed earlier on and as you can see it's all working so hopefully that resolved your issue hopefully now you can get your asp.net core application working in ios please leave some comments as to how you found this video whether it resolved it for you or whether you're having any other issues with is and until next time it's goodbye
Info
Channel: Round The Code
Views: 27,979
Rating: undefined out of 5
Keywords: ASP.NET Core IIS, ASP.NET Core not working, Publish IIS ASP.NET Core, ASP.NET Core not working IIS, ASP.NET Core IIS deployment, Publish IIS Visual Studio 2019, IIS Permissions, ASP.NET Core Runtime, 500.30 - ANCM In-Process Start Failure, 500.21, 500.19 error IIS 10, HTTP error 500.19 - internal server error IIS
Id: xnhEOBP-Hf4
Channel Id: undefined
Length: 7min 59sec (479 seconds)
Published: Tue Sep 15 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.