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

Johnson 21 Reputation points
2020-03-21T09:14:30.837+00:00

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
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,173 questions
0 comments No comments
{count} votes

Accepted answer
  1. Claudiu Ilutiu 76 Reputation points
    2020-03-21T12:27:44.073+00:00

    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://learn.microsoft.com/en-us/iis/application-frameworks/scenario-build-an-aspnet-website-on-iis/configuring-step-1-install-iis-and-asp-net-modules


0 additional answers

Sort by: Most helpful