Web Config Issue with IIS 7.5 MVC 5 App - asp.net-mvc

So I have an MVC 5 application which has been running fine and is published to two individual servers, with the same configuration, however one gives http status 500, the other works perfectly. Both servers are exactly the same windows release, and patched up to asp.net 4.5.1.
Browsing the site locally gives the source of the problem as the web.config file, with the relevant config source lines being -1: and 0: Both showing blank lines.
I've no idea what's going on with this one. I have copied the app in its entirety back from the working instance to the none working instance no avail.
I'm a bit stumped.
To note, i've also removed IIS and reinstalled as i thought that could be the cause of the issue.

So after much headscratching it turns out that some clown removed URL Rewrite module from this box. After reinstalling using the web platform installer all is well. I hope somebody finds this useful in future.
Nicolas Carlo, your response pushed me down an alternate route of diagnosing the problem and was helpful in this instance, thank you.

Related

eh.js and eh.css in IIS log

I just deployed a new MVC 4 web application and have been keeping an eye on the IIS logs to make sure everything is running smoothly. I noticed that some user's browser's request two files that do not exist in my project and I have no idea what they are: eh.js & eh.css. These two files are not part of my project and I don't know why they are being requested from the server, IIS returns 404. Has anyone else ran into this? Can anyone tell me what eh.js & eh.css are?
Well I feel sheepish, eh.js and eh.css are resources on my organization's error page.

ASP.NET4.0 MVC4 IIS7.5 Error 403.14 I'm Literally Pulling Out My Hair

I want to get away from developing in PHP but doing that is proving to be a massive headache.
I am trying to set up a website with MVC 4, ASP.NET 4.0, on Win7 Professional (64-bit). The website is just the basic site that is set up with Visual Web Developer 2010 Express selecting New Project > C# > Website > ASP.NET MVC 4 Application.
After setting up the application in IIS7.5 I am getting an HTTP Error 403.14 - Forbidden. I've done a ton of research and tried multiple different suggestions on how to solve the problem but NOTHING is working. Here are some things I tried:
Install/Register v4 of ASP.NET. This has been the most annoying
thing because everyone else's issue is fixed when they do this but
mine is not.
Changing the application pool settings:
Set to classic/integrated mode
Change the user/permissions used by the application pool
Made sure 32-bit applications were enabled
Added security permissions to folders related to the website (on multiple accounts)
I can get a regular html document to show up if I add it to the websites root directory. It seems that the MVC stack is not being called at all. The server wants to display the directory, which I can enable/disable, but the website is not being displayed.
Please can I have more potential fixes before I resort to my last desperate act? A baseball bat.
p.s. I'm more than willing to do a skype conversation or a share screen kind of thing if someone wants to dig in deep. I am beyond frustrated with this.
So it seems, in my indefinite well of stupidity, I was pointing the webserver to the incorrect folder. I needed to point the webserver to the folder with actual files of the application rather than the folder containing the .SLN file. Sorry to waste your time!
try running the aspnet_regiis
http://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx
open the command line in %windir%\Microsoft.NET\Framework64\v4.0.30319 and run
aspnet_regiis -ir
other possible solutions:
quit skype, or any other similar applications

Asp.Net-MVC application dying

I have a strange issue with an Asp.NET MVC application.
Using Asp.NET MVC 3 Preview 1 on IIS 7.5 - Integrated
After building the application everything runs fine. Then after some random amount of time (or sometimes after updating a view or js file) the application dies.
Meaning, requesting the root page, I get the 403 error and requesting any other page I get a 404 error.
After a rebuild everything works fine again for a little while until it dies again.
I am seeing this on two different development machines. Also, I have another application which is very similar (MVC 3, IIS etc) on both dev machines and this one runs without problem. I have inspected the config files in detail and cannot see anything of notable difference.
Does anyone know what could cause an application to die or where to look for further information? (I can still access elmah.axd though no information is there).
There's not much to go on here, but the 403 and 404 are clues that at least ASP.NET routing is not working; 403 is coming back because the web server thinks you want to do a directory browse, 404 because your request doesn't have a valid corresponding resource.
Since you are using the new version of MVC, I would suspect the issue may lye there. When you get the error condition, can you browse to a regular .aspx page? Does it execute server side code correctly?
You have the site hosted in IIS 7.5, not just the built in Visual Studio web server, right? Is it possible to turn on monitoring/event logging to see if IIS is taking a hit?
I apologize for not having any actual answer, sounds like you have a tough issue to debug.
Good Luck!

Deploying MVC Application to Web Server doesn't run correctly

I have reading posts all night looking for an answer to my issue and haven't found anything that works for me yet. I am sure there is a simple way to do this but I haven't been able to discover it yet.
Details:
MVC 2 Preview
Asp.net 3.5 sp1 framework
VS 2008 C# web application
Windows Server 2008
IIS 7
I have the application running well through VS 2008 no problem. When I hit the play to run in debug mode it starts the ASP.NET Development Server the application loads fine and works as expected, great!
When I publish the application locally or to my web server both on IIS 7 the application doesn't run correctly. Some of the icons are missing and the google maps map is missing. When I view the source it appears correct at first glance, but I can see the paths to the images are looking for the MVC paths and it isn't finding them. It appears the app is running as a regular asp.net app and not an mvc app, maybe?
I also tried to just hit the full source code locally on localhost and the exact same issue is present.
So, I guess my question is how do I deploy a MVC application to run the same in IIS as it does through the development server.
PS The environments are clean and pretty much out of the box.
#user68137 is correct in saying that you need to use relative paths for the images.
I got caught out on this one too, and here's my previous SO question about it...
In short, you need to do something like this...
<img src='<%= Url.Content( "~/Content/Images/banner.jpg" ) %>' alt="Banner" />
Hope this helps!
I had the relative paths set, but what I didn't realize is when I deployed it to the server it went to wwwroot\subsite... I had the relative paths set to src="....\image.jpg" to get back to the root of the site. My error was that if the site is not in the root then the subsite drills back to the root to find the images and of course doesn't find them. Same thing was happening with the JS files. I used the Url.Content and it worked great! problem solved!
The interesting this is when running through the VS dev server with a subsite it still worked well and found the paths even though it shouldn't have. VS dev server <> IIS
Thanks for your help on this!
Simon.
Once you know the virtual path to the location you are deploying the project to, you should go into the project configuration in Visual Studio and add it to your project. This way the visual studio development server will use the same path structure as the deployment server. This will save you countless hours of work when deploying.
When you run your website through Visual Studio, every single request gets processed through the ASP.NET pipeline, including images, CSS and other resources. IIS by default only processes specific extensions (e.g., aspx) unless you tell it otherwise through configuration. Paths like '/content/images/yourimage.jpg' should work just fine...I suspect it's something amiss in your IIS configuration.
Another possibility which I've run into is any custom ISAPI filters you may have installed on the IIS server (e.g., ISAPI_rewrite). It's easy to set up rules in its configuration that lead to some very unexpected results.

MVC - Routing not working within intranet

I don't know anyone can help but I'd appreciate any. I am developing an app in mvc (c#), now I had various routes working on my local development machine when the app was stand alone however now I've tried adding the project to the test intranet at work and none of the routes are working.
So where Localhost/Admin/Create worked fine locally where admin is the controller and Create is the action, when I try to get to testintranet.mywork.com/intranetsection/myproject/admin/create I'm getting a file not found error. I'm not sure what I need to change to get it to pick up the routing again rather than look for the literal path. The default.aspx page works fine and gets called but apart from that nothing. Is routing only viable when in a standalone project?
Cheers for any help.
It looks like you're either running on IIS 6 or IIS 7 classic mode. If you can, I'd recommend updgrading to IIS 7 integrated mode. If not, I have a walkthrough for getting up and running on IIS 6.
http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx
You don't say what version of IIS you have deployed to, but you may be running into the issues described here:
http://blog.codeville.net/2008/07/04/options-for-deploying-aspnet-mvc-to-iis-6/
I believe that most people chose to resolve this using a wildcard mapping for the aspnet_isapi.dll.

Resources