HTTP Error 403.14 in ASP.NET MVC2 application - asp.net

HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
This is my error... And I do NOT have IIS 7.0 installed locally. This is a remote host, which I pay for.
I found out how to fix this, but requires me to enter the IIS manager, which i can't.
Is there any way in Web.config I can tell the browser it should load up the default view or at least use the Routing table with the default route?
EDIT: Am I misunderstanding how to deploy an MVC2 project? It's not just copy the files or?

When I see this error on new servers at work it's usually because iis wasn't installed before .net was. You have to run the aspnet_regiis.exe -r on the server to register .net with iis...
I know this isn't what you want to hear but you should probably contact support of the hosting company and see if they can verify or not.

What version IIS are they running? What is your worker process setup to run? If its in classic mode, then you need a mapping from .mvc (or wildcard .) to aspnet_isapi. If its in integrated pipeline mode things should be a bit better. How did you deploy your MVC binaries? Put a test.aspx page in your app in the root folder - can you get to that?
So -
1. make sure your site works with an aspx file in it at the root
2. see what version iis your hoster is on and if they have setup anything for MVC if on iis6. If its IIS 7 ensure you are in integrated pipeline mode and not classic.

Related

ASP.NET Web Api application not running when deployed to IIS 8

I have created and Angular / ASP.NET application that work perfectly in VS using IIS Express. When I deploy it to IIS 8 on Server 2012R2 it does not work.
The Dot Net Framework 4.5 and ASP.NET 4.5 frameworks are installed per the many tutorials that I have found.
The setting: "runAllManagedModulesForAllRequests" is set true.
My default page 'index.html' is a single page Angular application that does load and execute correctly when I access the application url. The IIS server is serving up all of the requests without a problem. Except for routed Web Api requests. They all return 404.
I also put in some functionality for write to a file in the Application_Start method of Global.asax. The file is NOT being written. This tells me that ASP.NET code is not running at all.
I cannot find anything relevant in the Event viewer. The IIS log simply is telling me about the 404 error. Same as I am seeing in the network tab of developer tools.
I have searched the net generally, and stackoverflow specifically with no success.
What might I be missing? How do I go about troubleshooting this?
Thanks

"There was an error while performing this operation"

I have a website in IIS for which I cannot open any of the settings like Authentication, Handler Mappings, Authorization Rules etc. It just shows the error message "There was an error while performing this operation", with no more details and points to web.config.
Browsing the website results in a 500.19 error.
I tried adding iis_iusrs to the website folder and web.config, changing the app pool identity giving access to same on web.config/website folder security settings, verified target framework, iisreset/app pool recycles to no avail.
It turned out the website was using URL rewrite module which i was missing.
Downloaded web platform installer from MS and installed URL rewrite module.
http://www.microsoft.com/web/downloads/platform.aspx
Wish IIS errors were more informative than just "There was an error..."
I am running IIS 8.5 and I deployed my first Asp.Net Core 2.0 (Razor pages) site to the IIS Server (on Windows Server 2012 R2) that was running several Asp.Net Framework/Classic websites. This worked for me:
Install the .NET Core Windows Server Hosting bundle
https://learn.microsoft.com/en-us/aspnet/core/publishing/iis?tabs=aspnetcore2x#install-the-net-core-windows-server-hosting-bundle
It turned out the website was using URL rewrite module which i was missing.
This wasn't my problem and it was. I already had URL Rewriter installed, but after a Windows 10 upgrade IIS wasn't aware of it. A simple repair on Control Panel => Programs and Features => IIS URL Rewrite Module 2 and it was working again.
My issue was that I installed the .NET Core Hosting Bundle before I installed IIS. Re-running the Hosting Bundle installer with Repar fixed it for me.
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-3.1#install-the-net-core-hosting-bundle
If the Hosting Bundle is installed before IIS, the bundle installation
must be repaired. Run the Hosting Bundle installer again after
installing IIS.
I had this issue as well. Trying to run ASP.Net Core on IIS 10. All I needed to do was this:
Screen shot taken from: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/development-time-iis-support?view=aspnetcore-2.1
I had this issue lately , the solution for me was installing :
ASP.NET Core/.NET Core: Runtime & Hosting Bundle.
You can find it here.
Also before installing it , make sure your wwwroot security permissions is set to allow both iis_iusrs and iusr to have Read, Write and Execute permissions.
I installed .Net core Hosting Bundle from https://dotnet.microsoft.com/download/dotnet-core/2.2 and it fixed.
Similar to the marked solution here, I had the same problem and again it was a missing IIS module, but this time it was the Application Initialization Module that was required, not URLRewrite. installing via the Web Platform Installer or IIS.net. fixed the problem.
Steps I took to debug this though was to section by section go through my web config removing each section and attempting to load the site and/or let IIS parse the config. When I removed the section pertaining to initialization optimisation this fixed the issue and I immediately remembered that this dependency was added a fair while ago.
Echo the sentiments though that this really needs better error messages!!!
same here
also IUSR was missing from anonymous authentication credentials.
If the .net core Hosting Bundle is installed before IIS, the bundle installation must be repaired. Run the Hosting Bundle installer again after installing IIS.
works 100% ****check any urls are there inside <appSetting></appSetting>, try to comment these unknown urls
<!-- <add key="ErrorLogWebApi" value="https://websitename.com/api" />-->
and also comment <rewrite></rewrite> tag completely
now you try
I just double click on the Application that have the error and
change the version of the .NET Framework and
then change it back to the original version and
recycled the App Pools.
e.g.:
The application has .NET Framework v4.0.30319 and I changed it to .NET Framework v2.0.50727 then the Status was turn into Stop, then I double click back and change to .NET Framework v4 and then right click recycle and recycled it.
Same error message, but my C:\ had run out of disk space.

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. :)

MVC3 RC app deployed on IIS 6 giving "403 forbidden" error

I've deployed a very simple MVC3 RC app to an IIS 6 + Windows 2003 server. I'm just getting a "403 forbidden" error when trying to accesss the root. Right now the app is only one page, so there are no others to try out.
I noticed there is no longer a default.aspx in the root to handle default requests, could this maybe be the problem? Or is there some special config needed for IIS 6?
I've just deployed an MVC3 RC app on IIS6.0+win2003 server recently,
To get the route works correct ,all your should do is to intall .net framework4.0.
see this blog post from Haacked:
http://haacked.com/archive/2010/12/22/asp-net-mvc-3-extensionless-urls-on-iis-6.aspx
It depends. If you are using extensionless routes then yes there's a special config.
Must read: http://haacked.com/archive/2010/12/22/asp-net-mvc-3-extensionless-urls-on-iis-6.aspx
Also, I installed Webmatrix via Web Platform Installer just to make sure that I had all that I needed. Went through 2 reboots and voila~
I had the same problem with Windows Server 2003 IIS6 running a MVC4 app for the first time - in the end a .NET 4 repair (I downloaded the dotNetFx40_Full_x86_x64.exe file from Microsoft and executed it) did the trick!
Recently I again had the same problem on a rebuilt server and this time I had forgotten to check Web Service Extensions (bottom "folder" in IIS6) and found that ASP.NET v4 was Prohibited. I changed it to allowed, restarted IIS Admin Service from Services and it started working.

Cruisecontrol.NET & IIS7 Static File Handler Problem

I'm trying to get Cruisecontrol.NET running with Server 2008/IIS7 and when I try and navigate to the dashboard I get the following error:
HTTP Error 404.17 - Not Found
The requested content appears to be script and will not be served by the static file handler.
I'm a bit lost in IIS7 so it could be something pretty straightforward. They (cc.net) do some funny stuff with http handlers in the web.config which may be related to the problem:
Anyone have any pointers?
Is the dashboard set up as an application in IIS?
I've not used IIS7, but I know in IIS6 you need to enable an application and assign it to an app pool before you can run ASPX code.
EDIT: This works in IIS6.
Open the IISAdmin tool on the web server. Expand the web sites folder. Find the virtual directory (directories?) for CruiseControl. Right-click on it and look at properties. On the directory tab, create a new application and give it a suitable name. Enable the application to execute "scripts only". Assign it to an application pool (you may want to create a new one just for this application -- consult the help documentation for this). You may also need to change the ASP.NET version You can do this on the ASP.NET tab -- choose either v1.1 or v2.0, whichever CruiseControl requires.
In Vista, go to Windows features in the control panel. there is a section there for IIS and you will find the scripting setting under the IIS 6 compatibility section
I just had this same issue when I installed CCNET 1.5 under Windows 7/IIS 7.5
You need to configure the app pool for the ccnet site. Under the Basic Settings for the application pool, set 'Managed pipeline mode' to 'Integrated'.

Resources