Hosting/Publishing MVC3 on IIS6 - asp.net-mvc-3

So to be specific, I'm using a windows server 2003 (that means iis 6). I've already installed ASP.NET MVC 3 RTM and .NET 4.
I've tried a few guides already.I've tried Haacked's guide too, then navigated to the root.
eg.
localhost/MyWebApp which showed Directory Listing denied (permission related problem probably not relevant to my actual problem).
Visiting another view, localhost/MyWebApp/Home.mvc/Index, showed 404 error page.
Is there anything I'm missing? I don't have any visual studio installed on the server but should I have used the Web Platform Installer instead?

Is your app working correctly when you deploy it from visual studio to local IIS?
The "Home.mvc" looks a little odd - with the default routes that would imply a controller named "Home.mvcController", which is not valid.
The other obvious thing to check is that "MyWebApp" is set up as a web application using a .NET 4 app pool rather than just being a directory.

Related

Deploying .Net Core WebAPI project on IIS

I have created a simple web API using .Net Core and trying to publish it to IIS. But getting HTTP 500.
I followed https://docs.asp.net/en/latest/publishing/iis.html article and did exactly whatever mentioned in that.
I Installed only https://www.microsoft.com/net/download as
DotNetCore.1.0.1-WindowsHosting.exe OPT_INSTALL_REDIST=0
NOTE : I am able to deploy and access MVC application successfully but cannot access WebAPI application with the same steps.
In the IIS logs i am seeing below error.
Failed to start process with commandline '"dotnet" .\Project-1.dll', ErrorCode = '0x80070002'.
I am using the default web api template provided in Visual Studio 2015
am i missing something. Is WebAPI deployment is different to MVC app deployment w.r.t .net core ?
When you install the .NET Core Windows Server Hosting bundle, it won't restart all of the IIS processes if IIS is currently running. This is a good thing, since on a production server you wouldn't want them just to restart, but it would be nice if it was made a little clearer. First, check your System (not User) PATH variable to ensure that the path to Dotnet is there. Then, go into services and restart the Windows Process Activation Service. This will restart all of the IIS bits and get it to update the path. Once you've done this, IIS should serve up your .NET Core app just fine.

IIS Express not serving static files to Firefox

I'm using Visual Studio 2013 with IIS Express 8 to develop an application for a local Intranet. This application was built using ASP.NET MVC 4 in Visual Studio 2012 and later migrated to 2013. I had been using Visual Studio Development Server until I migrated to VS2013 with no issues.
After the migration, the application compiles, runs and authenticates fine, but it's not serving Static Files - it just returns an HTTP 500 response with no further details. See image below:
This also happens to Images and CSS files.
What can I check to solve this? Any suggestions?
UPDATE:
The application works fine in Local IIS (version 8).
It works in IIS Express on other PCs.
UPDATE 2:
After further testing, I found out that this only happens to Mozilla Firefox (it works fine in Internet Explorer and Google Chrome) - I didn't notice before because I always use FF. Currently using version 29.
Any ideas?
Finally! I was able to solve this issue with the help of this question.
This was happening because Firefox by default has Windows Integrated Authentication turned off. It doesn't make any sense to me why it works fine in regular IIS or in dynamic files (controller actions, WebApi, etc.), but that's a mystery for another day.
To enable Windows Integrated Authentication I followed this steps:
Type about:config in Firefox's address bar (nav bar)
Search for network.automatic-ntlm-auth.trusted-uris
Double click on network.automatic-ntlm-auth.trusted-uris
Add http://localhost to the list (paste that if it's empty)
After that I just hit F5 in Firefox and everything worked as expected.
This issue is poorly documented, so I wonder if nobody else uses Firefox with MVC to develop web applications using Windows Integrated Authentication?
Have you had a look at this ?
ASP.NET MVC application gives Internal Server Error only when viewed in Firefox
It doesn't explain why it works on IIS but there is a firefox doesn't support Integration Authentication out of the box.
The only thing that seems applicable to your situation is a problem with the install of IIS Express since this is an similar issue to something seen in previous IIS Express versions. I would either re-install it or see if your version of Windows can host IIS 8 in which you would just enable static content.
If this was just a matter of not having static content turned on or permissions for static content, you'd get a 404 or 401 error respectively. Hope this helps...
I'd look in the machine events viewer under application and system to see what the issue is.
Does the IIS serve anything up in the same folder such as .txt files, .html, jpg images?
It could possible be file or folder permission and/or the anonymous user being used to access them under IIS.
My first point would be event viewer though for more detailed information on the 500 error.

How to Deploy and Configure an MVC3 application using IIS6

I have created an application installer for my MVC3 project and have followed the BIN Deployment suggestions found online.
My site has been installed but I don't get any pages displayed.
This is how the VS2010 installer project looks
and this is how I have IIS setup
How do you get the Home Index page to be the default page as it is when I run the application through Visual studio?
IIS 6.0 doesn't support extensionless urls out of the box. This means that if you try to navigate to /Home/Index, IIS 6.0 doesn't know that this is an ASP.NET application and nothing happens. Extensionless urls are supported out of the box starting from IIS 7.0 when running the application in managed pipeline mode.
You will need to associate the unmanaged aspnet_isapi.dll filter with ASP.NET if you want to achieve that. Phil Haack covered how this topic in his blog post (ASP.NET 4.0) and this post (for CLR 2.0, which is not your case since you are using ASP.NET MVC 3).

Why can't I debug this very simple ASP.NET MVC3 application?

I decided to follow this tutorial on getting started with ASP.NET. I have Visual Web Developer 2010 Express (with SP1) installed, as well as the ASP.NET MVC3 tools.
I created the project and starting debugging it by going to Debug->Start Debugging - which then opened my browser to http://localhost:50531 and displayed:
According to the tutorial, that's not what I'm supposed to see.
Additional details:
OS: Windows Vista Home Premium 32-bit (with SP2)
I also have IIS 7.0 installed and running.
Did you use the presets or an empty project? If the latter, you don't have any controllers or views, thus the routing doesn't match anything, resulting in an error.

Azure SDK 1.4 - Cannot debug in VS2010 with multiple sites

I have a newly installed laptop running Win7/x64 and installed Visual Studio 2010, then VS2010 SP1, and then the Windows Azure SDK 1.4.
When I attempt to debug a cloud service project in the local compute emulator environment, I get an error: "The was an error attaching the debugger to the IIS worker process for URL 'http://127.0.0.1:5102/' for role instance..."
Some searching turned up quite a few discussions on this issue with the Azure SDK 1.3 update and I've narrowed down the issue to my having multiple sites in the same Web Role in my Azure application. If I comment out the sites entries in the ServiceDefinition.csdef, there's no error and debugging works fine. I tried the other recommended solutions, reinstalling .NET, re-registering ASP, rebooting while facing Redmond, but same problem.
I'm surprised by this issue on a new VS/Azure 1.4 installation and I'm hoping someone else has resolved supporting multiple sites for local debug.
Thanks!
I ran into the same problem, and have two suggestions:
If you've pointed to the "Published" output of a website and not the source location in ServiceDefinition.csdef, you'll get this error. Point to the source location of the web site when you're debugging. You can always switch the location later if you'd rather deploy a published web site rather than the source.
Ensure that you have debug set to false in the each of the web application's web.config file. While obvious, this catches me from time to time.

Resources