ASP.NET routing on IIS 6 - 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

Related

browser shows a blank screen when an asp.net core mvc application is run

I have created an asp.net core mvc web application in visual studio 2019 professional edition. After a successful build when I run the application, I am getting a blank screen in the browser. It is not showing the contents of the index page.
I checked the iis by typing inetmgr in the command window. It is opening up the iis Window. I also cross-checked in the browser window by typing http://localhost/. I am able to get the welcome page in IIS.
I don't know what's the issue here. Any valuable help is appreciated.
Please find the screenshot below.
When I faced a similar issue, it was due to the Web.config file, when the run httpRuntime was set to an incorrect target framework. Maybe remove the targetFramework parameter and see if the auto resolver resolves it.

Deploying mvc4 to linux

I've made my first website in ASP.NET MVC 4 for a customer, and he bought a host at 1eurohosting.net. On their website's FAQ it says
"Do you offer Windows based services?
We do not. We only offer Linux based services."
I've read that its still possible to run a MVC4 application on linux using mono, but how would I do this?
What I've tried so far is publish the website by right clicking solution explorer, and following the steps when u click "publish". The publishing works fine, and the files are on the webserver, but it doesn't run, because I think I need to use mono.
I don't know what to do at this point. What do I do next? If I have to use mono, how can I use it?
It seems that I either need a host that supports IIS or Mono. I dont think my current webhost supports Mono, I am still going to try and contact them, though.

Is it possible to run asp.net mvc 4 from within a folder of a main website?

I have successfully set up an API using ASP.NET MVC 4 on IIS6 (I used Phil's tutorial). When testing, we had it as the "Default website" and so there was no conflict with anything else. I am now being asked to set this up within a FOLDER of an existing website (the existing website is in ASP 1.0...and I cannot modify this...so I would some sort of virtual...something?). So basically, if we have https://www.ourcompany.com, they want the API to be available through https://www.ourcompany.com/api/.
Is this even possible? Phil's tutorial talks about setting up a Virtual Application, but I don't have that option in IIS (and if I had, I'm not knowledgeable enough about IIS to know if that would even allow me to access the API that way). I don't want anything that I set up to mess up the current website either, and there are a couple steps in the tutorial that I'll freely admit I don't fully understand.
If your curious as to WHY, the only advantage (besides being "neat") is so that the same SSL Cert can be used.
Yes that's definately possible at my work we had a similar setup, IIS6, a .NET 3.5 web, with a .NET 4.0 web nested underneath.
You would just set it up as a virtual directory underneath the parent website, point it to your folder, and ensure the value for the "Execute Permissions" dropdown is "Scripts Only" or above, and the correct .NET framework version selected on the ASP.NET tab.
There may be additional values you may need to over-write in your child web.config file, or, alternatively, wrap the entire parent web config with a "Location" attribute.
Forgot to mention, you may need to add manual script mappings for the child web if it doesn't work by default. (This installs the .NET 4.0 script mappings to a specific web) though again not sure if this is required by default. See: http://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx
One more thing - If you're using REST (or an extension less URL mapping which I believe an MVC 4 web will use) - You'll need to add a "wild card" script mapping, which basically tells IIS to serve requests with no extension with the .NET 4.0 framework - See here However where they're referencing .NET 2.0 folders, you'll obviously want to reference the same files but in the .NET 4.0 folders :)
Thanks

Issue Hosting Silverlight Application on IIS 7.5

I have an ASP.NET web application (.NET 4.0) that has a few pages, one page with a silverlight application in it.
When I debug locally, the silverlight app works fine. When I deploy to my web server (Windows Server 2008 R2, IIS 7.5), the silverlight app will not display.
I get an exception in Application_Error saying the following files are missing:
clientaccesspolicy.xml
crossdomain.xml
I have found a few things on the net that aren't very helpful - they say they need to be in C:\inetpub\wwwroot. I don't have a 'Default' website in IIS7.5 and I don't have these folders?
Where can I find them and where should I put them?
Please help, as this is very urgent. Many thanks.
EDIT: So I have tried doing what the link in my comment suggests. Some more info: I have a Silverlight-enabled WCF service that the Silverlight app uses in order to work.
Do I need to do anything special when deploying my app with an .svc file? I remember having to enable access to .svc files back in IIS5, but I don't know if that's necessary in IIS 7.5?
Hope this extra info helps. If you need any code snippets etc, let me know.
Thanks.
Well, worked it out - a slightly embarrassing and annoying problem..............
The service reference in the Silverlight application had a client address of 'http://localhost......', which was added by Visual Studio when I added the service reference.
I found a blog post by Tim Heuer describing the issue. I had to set the client address to a relative one, using '../Service.svc' in the ServiceReferences.ClientConfig.
Very annoying, sort that out please Microsoft!!!

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