Deploying MVC 4 with Razor on IIS 7 - asp.net-mvc-4

I've created an MVC 4 project and am trying to deploy it on IIS 7. I've seen a lot of suggestions and tried some and had no luck. I'm very new to IIS so I need this explained as thoroughly as possible if someone can. I currently run my MVC application from localhost and then I add something like this to the end of the URL.
/data/filldata?name=...
So my first question is, how do I deploy the MVC website to IIS. My next question is, after deploying it, how do I run it? If I open a web browser, what should I put in the URL. My assumption is the new URL with the directory it's set up in and then that /data/filldata?name=... at the end. Keep in mind that I am a beginner in this so I'm slowly starting to learn how to use IIS. Thanks in advance!

Related

Attach to MVC 6 process in IIS

I am hosting an asp.net 5/mvc 6 application in local IIS using dnx x64 1.0.0.rc1. I would like to attach to the iis process and debug my application, but no symbols are ever loaded for the classes that I set breakpoints in.
Is this possible with this version of dnx and IIS?
If so, how do I attach to the iis process with symbols loaded?
---UPDATE
So I've tried attaching to dnx.exe, but still no luck. Strangely, I was able to get this to work one time, but cannot replicate it again. So if anyone can outline the steps required to debug MVC 6 on IIS, please post here.
What process are you trying to attach to? I believe you should be attaching to dnx.exe

Deploy MVC 6 app in IIS

I'm using Visual Studio Express 2015RC and I created a simple MVC 6 application, but when I try to publish it I don't see the option to deploy it to IIS, I see the options Microsoft Azure Web App, Import and File System, I tried the File System but It looks like it is more for creating stand alone applications to be launched from a console, now, when debugging I can select IIS Express or the web command, there is no IIS option, so the question is, how can I deploy the MVC6 web application I created to IIS?
File System publish is actually exactly what you want; All DNX applications are stand-alone, whether for ASP.NET 5 or a console app.
When you publish to the File System, you get a few folders; the wwwroot (assuming you kept the default in your project.json) folder is where IIS should point. The web.config in that folder is generated for you automatically assuming you keep everything else where it is.
For what it's worth, the official documentation will probably be here, once it's written. Also, on Stack Overflow, ASP.NET 5 project hosting on IIS probably has some useful information, though it looks like it's a bit out of date at the moment.

MVC 4 WebApi 404 when published to production

I've been working on a new MVC 4 application and in the development environment everything has been working correctly, yet after deploying to our production environment I've found that my WebApi's no longer resolve and as a result I'm only getting 404's when I try to use my api's
I've checked my web.config and I can't find anything that's as miss and I've made sure that I've got the following in my web.config
<modules runAllManagedModulesForAllRequests="true"></modules>
however this is not helping either.
I've also in an attempt to make sure that the server would run the MVC 4 project I've even installed the MVC4 framework which has not helped either.

RIA: "Use local IIS Web server"

I know I've had this problem when I started working with Silverlight, but I can't for the life of me remember how to fix it.
I created a new RIA service application using the standard tutorial, added a table from the database and added a grid to display the results. Works great. Now I pull open the Web properties and change the web project to "use local IIS Web server". Suddenly the application will load up and give me the friendly "NotFound" error.
Please, someone remind me what I'm missing here.
I ran into this problem recently, and resolved it with help from this post on the silverlight.net forums.
Basically, I had Windows authentication and annonymous access enabled at the same time, and I need to disable windows authentication and restart IIS.
John
Not sure what the missing part is but I always start with Fiddler as will show the messages going across the wire. The actual messages can contains far more useful that the browser is hiding from the Silverlight plugin

ASP.NET routing on IIS 6

I have created a basic site using ASP.NET routing according to Mike Ormond's example "Using ASP.NET routing Independent of MVC". This works fine on my local machine running the built-in web server.
However, when I deploy it to my server (Windows Server 2003, IIS 6, ASP.NET 3.5 SP1) it just shows a 404 error.
I have read somewhere that I am meant to set up wildcard routing. How can I do this?
What other configuration changes needs to be done to make it work on my server?
You will find some good information on Steve Sanderson’s blog post "Deploying ASP.NET MVC to IIS 6."
On the server, open IIS:
Right-click on the site/virtual directory, select properties
Goto the Home Directory/Virtual Directory tab, click Configuration (near the bottom)
Near the bottom again, click the insert button
Enter C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll
Alternate: Enter C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll for ASP.NET 4.0
Uncheck the "Verify that file exists" button, click Okay and close all the dialogues
You can find the "official" discussion of wildcard mappings on TechNet here but I like Phil Haack's walkthrough that you can find here. Don't worry about the fact that it's a discussion of setting up ASP.NET MVC, just look for the section titled "IIS6 Extension-less URLs" - that set up applies to both MVC and using routing with a classic web form application.
Under IIS 6 64 bit, make sure that the path under 4.) points to
C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll
Url rewriting can help you to solve the problem. I've implemented solution allowing to deploy MVC application at any IIS version even when virtual hosting is used.
http://www.codeproject.com/KB/aspnet/iis-aspnet-url-rewriting.aspx