Many thanks to Duncan Smart whose comment on my previous post about deploying ASP.NET MVC applications to IIS 6 gives us a further option. It turns out that even though IIS Manager only lets you configure wildcard maps on a per-application level, IIS itself allows you to configure them on a per-directory level.
Recap: The goal here is to deploy ASP.NET MVC applications to IIS 6, keeping the clean, extensionless URLs (which requires a wildcard map so that all URLs are processed by ASP.NET, or some tricky URL-rewriting), but without incuring the performance penalty of letting static files get processed by ASP.NET. See the previous post for more details.
So, if you can be disciplined and keep all your static content inside your /Content folder, you can use a normal wildcard map at the root level to get ASP.NET MVC to handle all incoming URLs, even without any “filename extensions” in the URLs, but then also disable that wildcard map on the /Content folder and below, allowing those static files to be processed natively by IIS (which performs much better).
How to set it up
First, deploy your application and use a wilcard map as explained before. Next, find out the “identifier” of your application by looking at IIS Manager:
Now, to remove the wildcard map on the /Content subdirectory, open a command prompt, go to c:\Inetpub\AdminScripts, and run:
adsutil.vbs SET /W3SVC/105364569/root/Content/ScriptMaps ""
… replacing 105364569 with the “identifier” number of your application. (Also, you could replace “Content” with the path to any other directory.)
That does it! Your /Content folder will now bypass the wildcard mapping, and its files will be served natively by IIS.
Alternative
If you don’t like to use adsutil.vbs, you can achieve the same by exploiting what appears to be a bug in IIS Manager. Turn your subdirectory into an application (from its Directory tab, click “Create”). Then edit its script mappings to remove aspnet_isapi.dll. Then go back and “Remove” the application you just created. The metabase’s new ScriptMaps value will be retained, even though the option has now disappeared from the GUI.
79 Responses to Overriding IIS6 wildcard maps on individual directories
Nice post, you got some good points there – thank you.
Yeeeeaaaaahhhhhh!!!! It works perfectly even on Windows XP
))) Thanks very much!!!
))
One more thing. I run Fiddler and check content headers. For static files IIS send proper headers and IE (Firefox too) caches files – IIS responds 304.
How it is possible? Maybe StaticFileHandler is smarter now?
OMFG! After fighting with this for nearly 2 months on and off, your solution has finally solved this issue for me. THANK YOU VERY MUCH!!!
You could also use Metabase Explorer (included in the IIS 6 Resource Kit) [http://support.microsoft.com/kb/840671#8] to edit the IIS metabase
Thank you! This has greatly increased performance in one of our servers running IIS 6
I am trying to use option 1 but it is not working. The regular 404 page still gets invoked and asp.net does not show the asp.net “resource is missing” page. Any suggestions what I could have done wrong?
Natalie, one possibility is that you haven’t enabled ASP.NET (in IIS Manager’s Web Service Extensions)
Steve -
To be frank… you’re the man when it comes to MVC! Days of frantic playing about, and then your blog comes to to the rescue (not for the first time I should say). I’m paying a visit to Amazon…
Thanks for finding this workaround!
I’ve used it in a bit different way: for enabling wildcard ASP.NET processing on a specific folder and it worked. So root and all folders except “X” are processed as usually, but all requests to “X” get passed to aspnet_isapi.dll.
Pingback: Getting ASP.Net MVC running on IIS6
I found that just running the script against a directory would return an ‘object not found’ error from adsUtil script. However going into IIS and creating, then removing the application on that directory (IIS Folder properties) allowed the script to work (because the object entry was now in the metabase??)
This is great… how do you verify that it is working as expected. For example, using Fiddler, what would you look for?
I implemented but I don’t see any difference in performance or response. As Jesse says, how do we know this is actually doing something different?
Pingback: 随风飞扬 » Blog Archive » Deploying ASP.NET MVC to IIS 6
You can verify if this is working or not by doing the following:
1. Setup Forms Authentication and or setup a page that requires authentication at the root level of that directory. E.g. yoursite/Admin/Default.aspx would require authentication.
2. Within this folder you will invariably have an images folder or images somewhere. Let’s say the address is yoursite/Admin/Images/mycar.jpg
3. Natively .NET will NOT require authentication for none “.net” resources like images. So if you ensure you are not authenticated then paste the absolute address of the image file into a browser i.e. http://www.yoursite.com/Admin/Images/mycar.jpg, your browser will display the image EVEN though this image is within a password protected area of the site. ASP.NET’s authentication system is not hit because the request is not for a .NET resource.
4. If you have wildcard mapping enabled and it is acting upon requests for such a file, then instead of showing you the image, you will be required to login as the request will have gone through .NET and .NET would have invoked authenticated restrictions on the file.
So yes, it can be tested.
Here is another way to test that it works:
Drop app_offline.htm that has links to css or images in content folder and see if it displays.
Thanks for this good read. I actually appreciated it and I have bookmarked you to check out the fresh stuff you post.
Nice site man! Keep up the good work haha.
A semen fluid volume analysis examines some characteristics of a male’s semen fluid volume and the amount of sperm that is contained in the semen. It may be done while investigating a couple’s infertility or maybe after a vasectomy to check that the procedure was done successful. It is also used for testing some donors for semen donation. In the last few years it is really possible to increase semen fluid with absolutely safe ways like taking herbal pills from the many Internet stores. Sperm volume is the volume of semen concentration of sperms in your seminal liquid. A lot of factors are taken into consideration to measure the sperm count of a man such as the true length of time between ejaculations, semen sample analysis, how the sample is kept when being transported to the lab. Natural tablets is really awesome 100% herbal tested formula that without doubt will hugely increase the volume of semen ejaculation liquid by up to 500 percent. The amazingly leading herbal tablet contains a lot of ancient South African minerals, herbs and vitamins.
Hello there. Appreciate your site. I check it regularly to see the latest info.
Just want to say hello. Really awesome blog design. May I ask what template this is?
Just want to say hi. Really cool blog design. May I ask what theme this is? I’ve been trying to find a good one for a while.
I appreciate your work , thankyou for all the informative posts .
olá galera, verdadeiramente enviar um SMS gratuito está cada vez mais difícil devido ao bloqueio das operadoras de celular. Há ainda os serviços que prometem entregar meu SMS mas nem sempre chegam destinatário final. Alguns como o Mundo oi e o Oi Torpedo funcionam mas e para as outras operadoras? E os que prometem que enviam e nada chega. Para onde está indo as meus torpedos? E para a Tim, Vivo? Alguma Idéia? Ou significa ter de pagar?. É só um desabafo, realmente está difícil achar serviços para mandar torpedos barato.
The very core of your writing while sounding reasonable originally, did not sit perfectly with me after some time. Someplace throughout the sentences you managed to make me a believer but only for a short while. I nevertheless have got a problem with your leaps in assumptions and you would do well to fill in those breaks. When you can accomplish that, I would undoubtedly be impressed.
I am curious to find out what blog platform you are utilizing? I’m experiencing some minor security issues with my latest blog and I’d like to find something more risk-free. Do you have any suggestions?
Thank you for unshared
But I must put more pictures.
Affects people to pretty pictures.
I really liked your site. Good luck.
Good stuff! I’m happy to see the new structure on your blog urls.
Hello, I can’t understand how to add your internet site in my rss reader. Can you Aid me, please
This is really interesting, You are a very skilled blogger. I’ve joined your feed and look forward to seeking more of your magnificent post. Also, I have shared your site in my social networks!
The quality of features crammed on the 3DS does come inside cost of a poor life of the battery. Nintendo were forthcoming concerning 3-5 hour battery, though which doesn’t allow it to less of a challenge to swallow. Usually there are some power saving ideas to push the playtime better the 5 hour mark: turning trip 3D, decreasing the brightness, making sure that wireless is deactivated. Though they can believe that hefty compromises for only a all-singing, all-dancing portable. The 3DS is probably a system you might play an awful lot while home, with the means to access an electric point, however, the key paltry battery could leave numerous commuters disappointed halfway owning an important boss battle. Bear in mind to bring along your charger and keep abreast of the red light. If the system is due to sleep mode, dealing only have a minuscule number of power, which is certainly handy.
I’m really easy to get along with once you people be able to see it my technique.
I love the precious information you provide within your articles. I am going to bookmark your blog and get my kids check up here regularly. I am quite sure they are going to study a lot of different stuff listed here than anyone else!
I wonder how you got so competent. HaHa! This can be a fascinating blog, a lot of stuff that I will end up in. One thing I just want to express is that your design is so perfect! You certainly learn how to obtain a girls attention! Im glad that youre here. I feel as if Ive learned a new challenge since they can be here.
I think this is among the most vital information for me. And i am glad reading your article. But should remark on few general things, The web site style is ideal, the articles is really great : D. Good job, cheers
Just wanna remark that you have a very decent site, I love the design it actually stands out.
Couldn?t be written any better. Looking over this post jogs my memory of my old room mate! He always kept discussing this. I’ll forward this article to him. Pretty sure he will have a good read. Many thanks for sharing!
Appreciate it for helping out, superb information.
My husband and i felt really happy that Albert managed to finish off his studies using the ideas he made in your site. It is now and again perplexing to simply always be freely giving tactics which often some people could have been making money from. So we acknowledge we have the blog owner to thank for this. The most important illustrations you’ve made, the simple web site navigation, the friendships you can make it easier to promote – it is everything great, and it’s really assisting our son and us consider that the issue is brilliant, which is especially serious. Thank you for all the pieces!
Just found your site, but i found some problems browsing. The links in your sidebar aren’t working at the moment…
Its like you read my mind! You appear to know so much about this, like you wrote the book in it or something. I think that you can do with some pics to drive the message home a little bit, but instead of that, this is fantastic blog. A fantastic read. I’ll certainly be back.
Simply want to say your article is as astonishing. The clarity in your post is simply cool and i can assume you are an expert on this subject. Well with your permission allow me to grab your RSS feed to keep updated with forthcoming post. Thanks a million and please continue the rewarding work.
Excellent post, cheers for submitting. I look forward to reading more from you. Also, I’m interested in where you got your blog template -Alex
Howdy very cool blog!! Guy .. Excellent .. Wonderful .. I will bookmark your site and take the feeds also…I am satisfied to find a lot of helpful information here in the post, we’d like develop more strategies in this regard, thank you for sharing. . . . . .
Cheers to your speech regarding reason nevertheless this post is likely to put your damper within the sales associated with tinfoil caps.
For some reason only another half of the post is being scene, is it my web browser or the site?
The man who in view of gain thinks of righteousness; who in the view of danger is prepared to give up his life; and who does not forget an old agreement however far back it extends such a man may be reckoned a complete man.
you’re really a good webmaster. The site loading speed is amazing. It sort of feels that you’re doing any unique trick. Moreover, The contents are masterpiece. you have done a wonderful task in this matter!
Definitely believe that which you said. Your favorite reason seemed to be on the net the easiest thing to be aware of. I say to you, I certainly get irked while people consider worries that they just don’t know about. You managed to hit the nail upon the top and also defined out the whole thing without having side-effects , people can take a signal. Will probably be back to get more. Thanks
Aw, this was a really nice post. In concept I would like to put in writing like this moreover – taking time and precise effort to make a very good article… but what can I say… I procrastinate alot and not at all seem to get one thing done.
Its like you read my mind! You appear to know a lot about this, like you wrote the book in it or something. I think that you can do with some pics to drive the message home a little bit, but instead of that, this is wonderful website. A great read. I’ll definitely be back…
Hello, amazing topic I have just liked your facebook
Please let me know if you’re looking for a author for your site. You have some really great articles and I think I would be a good asset. If you ever want to take some of the load off, I’d absolutely love to write some content for your blog in exchange for a link back to mine. Please blast me an email if interested. Thanks!
An interesting dialogue is value comment. I feel that you must write extra on this topic, it might not be a taboo subject but generally persons are not sufficient to talk on such topics. To the next. Cheers
Just wish to say your article is as surprising. The clarity in your post is just cool and i could assume you are an expert on this subject. Fine with your permission allow me to grab your feed to keep updated with forthcoming post. Thanks a million and please keep up the enjoyable work.
When installing Joomla on my computer in order to update a preexisting site, do I need my client to give me the Host Name, MySQL User Name, MySQL Password, MySQL Database NAme and MySQL Table Prefix? I already have their FTP information, and the Joomla admin control panel login information..
Hey there every person, if you’re as intrigued in this short article as me, please make sure to email me, I would enjoy to chew the fat about that. My email is above. Bless you!
Heyyy. Are you looking for a Assisted Living Facilities?
Its like you read my mind! You seem to know so much about this, like you wrote the book in it or something. I think that you could do with some pics to drive the message home a bit, but other than that, this is great blog. A fantastic read. I will certainly be back.
I like this website very much, Its a rattling nice billet to read and obtain info .
17. Thank you for the good writeup. It in fact was a amusement account it. Look advanced to far added agreeable from you! However, how can we communicate?
Splendid internet! I truly adoration just how it’s hassle-free with my eyes together with the word may be adequately written and published. I’m wondering could may very well be distinguished at any time when a brand new submit is make. I even have subscribed to your rss supply which will should do the trick! Use a agreeable day!
We are a group of volunteers and starting a new scheme in our community. Your site offered us with valuable info to work on. You’ve done an impressive job and our entire community will be grateful to you.
I like what you guys are up too. Such smart work and reporting! Keep up the superb works guys I’ve incorporated you guys to my blogroll. I think it will improve the value of my site .
Could i simply claim what a therapy to seek relative no one actually is familiar with how theyre posting about on line. That you know how to deliver an issue to mild and produce this vital. More people must study these and fully grasp this kind of facet of the chronicle. I cant trust youre you can forget popular as you definitely have the offer.
Neat blog! Is your theme custom made or did you download it from somewhere? A design like yours with a few simple adjustements would really make my blog jump out. Please let me know where you got your theme. Appreciate it
Bookmarked the site! Hope you will be posting more quality articles in the future.
Remember the Lord your God, for it is He who gives you the power to get wealth. – Deuteronomy 8:18
Painting CVontractor Birmingham
I think a visualized presentation can be superior then simply a simple text, if things are defined in sketches one can easily be familiar with these.
3. Great post. I was checking constantly this blog and I’m impressed! Extremely useful info particularly the last part
I care for such info a lot. I was seeking this particular information for a very long time. Thank you and best of luck.
Basically to follow up on the up-date of this subject matter on your blog and would like to let you know just how much I treasured the time you took to write this valuable post. Within the post, you really spoke regarding how to truly handle this issue with all ease. It would be my pleasure to collect some more ideas from your site and come up to offer some others what I have benefited from you. Many thanks for your usual excellent effort.
Thanks for sharing such a good opinion, paragraph is fastidious, thats why i have read it fully
Thank you so much regarding giving everyone an update on this issue on your web-site. Please realise that if a fresh post appears or when any modifications occur to the current article, I would be considering reading more and focusing on how to make good usage of those techniques you share. Thanks for your time and consideration of other people by making this website available.
I’ve been absent for some time, but now I remember why I used to love this weblog. Thank you, I will try and check back far more often. How frequently you update your internet internet site?
I wasted money on cigarettes for forever. I understand it hurts my overall health so I wish to quit smoking though it’s difficult. None of the quit smoking gadgets worked for me. Then I heard about the smokeless cigarettes e liquid. It’s basically saved my life. No longer breathing toxic chemicals feels superb!
Just want to say your article is as surprising. The clarity in your post is just nice and i can assume you are an expert on this subject. Fine with your permission allow me to grab your feed to keep updated with forthcoming post. Thanks a million and please continue the enjoyable work.
I wanted to observe up and let you know the way , a fantastic deal I cherished discovering your internet blog today.