Deploy ASP.Net MVC web app to IIS with 403.14 Error - asp.net

I'm using .NET Framework 4.8 and tried to deployed my web app to IIS but it showed the 403.14 error.
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
And then I enabled directory browsing. This time, it showed the directory listing instead. As I clicked the "Views" folder, it returned another error.
HTTP Error 500.21 - Internet Server Error
Handler "BlockViewHandler" has a bad module "ManagedPipelineHandler" in its module list
I have been finding solution for days but none of them worked...
EDIT: I started a new MVC project and tried to depoly it. It works perfectly. But it broke once I added new database using entity framework. Just guessing the problem comes from the database. Is there any configuration if I want to deploy a MVC app with db?

Related

Is there any way to see actual application error in a website hosted in IIS?

A legacy .Net webform application is hosted in IIS is running fine in old server having .Net framework 2.0 in it. I don't have source code of the application. I have just existing published DLL which i have copied from old server to a new server having .Net 4.7 framework by default and hosted it in new server's IIS.
While browsing the application, it is showing an default configured Error.aspx page which developers may have configured. So, in case of any error the application will navigate to Error.aspx page.
I am not able to figure out the actual .net error.
How can i get the actual error or is there any way to debug that ?
You can find errors in iis log (default path is %SystemDrive%\inetpub\logs\LogFiles).
Also you can enable detailed error message in browser. Link

HTTP Error 500.19 - Internal Server Error - what is the cause?

I have created an Angular2/.NETCore application in Visual Studio, which when debugged works fine. I published this on my local IIS, and this also is running fine. However when I moved everything to a remote server, I got the following error:-
HTTP Error 500.19 - Internal Server Error
Detailed Error Information:
Module IIS Web Core
Notification Unknown
Handler Not yet determined
Error Code 0x8007000d
Config Error
I checked that I have the correct permissions on the remote IIS, however I cannot understand why I am getting this error.
I already tried the following link
but no luck so far.
Anyone has any idea what the problem might be?
Thanks for your help and time.
Install the .NET Core Windows Server Hosting bundle on the hosting system. The bundle will install the .NET Core Runtime, .NET Core Library, and the ASP.NET Core Module.
For more information refer this link.

Resolving the 403.14 error for ASP.NET on Windows Server 2016

I am working with a brand-new Windows Server 2016 virtual machine and I deployed an ASP.NET MVC Web API application on it using Web Deploy from Visual Studio 2017. However, I found that when I browsed to the application locally, I received a page with the following error:
HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory.
After doing some research online I found that this is a common issue and that many solutions have been given. For example, see the following:
ASP.NET MVC on IIS 7.5
MVC4 HTTP Error 403.14 - Forbidden
HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents
ASP MVC in IIS 7 results in: HTTP Error 403.14 - Forbidden
HTTP Error 403.14 - Forbidden - MVC4 .net 4.5 bundles
HTTP Error 403.14 - Forbidden. Asp.NET MVC
HTTP Error 403.14 - Forbidden IIS Error for ASP.Net MVC 4 Application
However, none of the solutions I tried resolved this problem on my Windows Server 2016 instance.
Here's the solution that worked for me:
Many people suggested running the following command to register ASP.NET on the machine:
%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -ir
It turns out that in Windows Server 2016, you need to go to the Add Roles and Features Wizard to do this (search for "turn windows features on or off" in the Windows search). In the wizard, click Next until you get to the Server Roles page. Scroll down and open the following node:
Web Server (IIS) > Web Server > Application Development
Put a checkmark next to "ASP.NET 4.6" and click Next, and follow the prompts to install it.
After installing ASP.NET 4.6 I found that the 403.14 issue was resolved.
I Removed Rewrite module from Modules and working well now.
NOTE: Referencing a drive that does not exist can cause this issue! We referenced E:\Log4Net but on a new host, this drive did not exist!

Does ASP.NET MVC have to be installed on the deployment target machine?

Does ASP.NET MVC need to be installed on the machine that you are trying to deploy your ASP.NET MVC 3 website to?
I thought that since the bin folder of your application already had the System.Web.Mvc and other necessary DLL's, it wasn't necessary to install MVC on the deployment server as long as ASP.NET (the version you are targeting, in this case v4) was installed.
I am using IIS. I don't know which version, but it has the classic view so it must be 7 or earlier. The default application pool looks like this (and it has no modes):
The About box doesn't display a version number. The MMC Snap-in Management Console version is 3.0. This is running on a 64-bit Windows 2003 R2 Standard Edition server.
Why I am asking this / What I am trying to do
I deployed my MVC app by making a deployment package, moving it to the server and then running the deployment script (.cmd file). The application directory was created in IIS. However, when I browse to the application, I get a 403 saying Directory Listing Denied, which makes sense. IIS is not able to resolve the MVC routing thing.
I checked a couple of threads here and they all (thread 1, thread 2) seem to suggest that MVC 3 must be installed on the target. I'll do this but I just wanted to check. Does it really need to be installed?
Windows Server 2003 R2 ships with IIS 6. See this about routing: Deploying ASP.NET MVC to IIS 6
As bertl said, if you deploy the web app with the binaries, it would work (assuming the correct .NET version is already installed and web site / application pool is configured properly.)
It is correct that you don't need to install MVC on the server. This works if you include the DLLS with your deployment. This is what many call "BIN deployment".
Scott Hanselman describes very nicely how this works.
Another (easier) way is described by Phil Haack.
Here is an awesome article I used many years ago to resolve the routing for IIS 6
http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx
You definitely need asp.net 4.0. You could copy all the dll's into the bin folder but preferably installed on the host would be the better idea. Depending on the version of IIS, pre 7, you would have to make some adjustments for the routing as well.
Yes you dont need to install asp.net mvc3 on the server. The server I'm using don't have Visual Studio on it. You just need a proper server configuration. Apparently there are several reasons that results to 403 and 404 error.
403 - Forbidden
403.1 - Execute access forbidden.
403.2 - Read access forbidden.
403.3 - Write access forbidden.
403.4 - SSL required.
403.5 - SSL 128 required.
403.6 - IP address rejected.
403.7 - Client certificate required.
403.8 - Site access denied.
403.9 - Too many users.
403.10 - Invalid configuration.
403.11 - Password change.
403.12 - Mapper denied access.
403.13 - Client certificate revoked.
403.14 - Directory listing denied.
403.15 - Client Access Licenses exceeded.
403.16 - Client certificate is untrusted or invalid.
403.17 - Client certificate has expired or is not yet valid.
403.18 - Cannot execute requested URL in the current application pool. This error code is specific to IIS 6.0.
403.19 - Cannot execute CGIs for the client in this application pool. This error code is specific to IIS 6.0.
403.20 - Passport logon failed. This error code is specific to IIS 6.0.
404 - Not found.
404.0 - (None) – File or directory not found.
404.1 - Web site not accessible on the requested port.
404.2 - Web service extension lockdown policy prevents this request.
404.3 - MIME map policy prevents this request.
For the solution Check this link here. I found that link very useful. I hope it will also help you. :)

Issues within an ASP.NET 2.0 Web Application to Look for When Running on Linux with Mono

My IT department and I are trying to get an ASP.NET web application to run on a Linux with Mono. We have been working on this for about a month to no avail. The Mono setup on the Linux server seems to be good. We are able to run the demo ASP.NET pages on the server and they work fine.
I developed my ASP.NET web application with Visual Studio 2008, and I recently downgraded the application to ASP.NET 2.0. Originally it was in ASP.NET 3.5, which might be the problem. After publishing the web app, I received the following files: Default.aspx, Web.config, bin (with a .dll and a .pdb file), and an empty App_Data file. So far, the error that keeps occuring is an appication error on the server.
For a simple test, I made a simple ASP.NET web app that had a label and a button. We tried that app and it did not work either. Does anyone know of things that I should look for within my ASP.NET web application that would inhibit the application to work?
Application error:
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. this tag should then have its "mode" attribute set to "Off".
!--web.COnfig Configuration File--
configuration
system.web
customErros mode+"Off"/
/system.web
/configuration
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's configuration tag to point to a custom error page URL.
!--Web.Config Configuration File--
configuration
system.web
customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/
/system.web
/configuration
Thank you,
DFM
Just for a resolution, I finally figured out what the problem was. The ASP.NET web app has an onload event that enables the web app to read an Access Db. For testing purposes, I did not update the ADO.NET Db path for the web app to read the Db so every time it was loaded through Mono, the generalized error in question would occur. After deleting the onload event, the web app functioned perfectly. Additionally, I had to downgrade the web app to ASP.NET 2.0, instead of 3.5, and delete the LINQ namespaces, which were not being used.
All I have to do is change the path(s) to point to the App_Data folder and place the Db in the folder, as well.

Resources