question

Johnson-5080 avatar image
Johnson-5080 asked ·

Hosted on Azure VM by IIS but it dont read ASP.NET MVC C# file

Hi everyone,

I'm new to Microsoft Azure VM and trying to host my website on it.

I've followed all the steps and successfully hosted it but the IIS do not understand my hosted file is ASP.NET MVC C#

Eg:
In local file, when i run it looks like -> localhost/Admin/Login
In IIS, when i run -> ipaddress/Admin/Login, it shows '404 - File or directory not found.'
In IIS, when i run -> ipaddress/Views/Admin/Login, it shows '500 - Internal server error.' with the error message related to web config file.

Anyone know how to solve this issue? Appreciate your helps.

azure-virtual-machines
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ClaudiuIlutiu-3094 avatar image
ClaudiuIlutiu-3094 answered ·

It would be great if you could have the exact / detailed error by changing customErrors to Off in your web.config. Sometimes you get the errors in Event Viewer / Windows logs / Application from windows.

You probably don't have asp.net installed / configured on the IIS. Here is a guide to install it :
https://docs.microsoft.com/en-us/iis/application-frameworks/scenario-build-an-aspnet-website-on-iis/configuring-step-1-install-iis-and-asp-net-modules

1 comment Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks! All i miss out is the asp.net installation in IIS. Appreciate it.
Now have to figure out how to attach my DB with it

0 Votes 0 · ·