Asked by:
machine.config settings via multiple CLR/bitness

Question
-
User-234406897 posted
Hi there,
I am compiling a best practice/hardening/optimising administrators guide for IIS 7.x. Hopefully with the goal of getting it on TechNet or something.
Although I am happy with my understanding of all things IIS with the more and more integration with the asp.net - I get a little lost with the deep dive settings, hence the post here.
I want to get a better understanding/confirmation of some of the inheritance from the machine.config level downwards.
I get the understanding of this. i.e. I understand stuff in here.
What I am a little confused about is all the different CLRs machine.configs and how that effects it all.
e.g.
asp.net CLR v2 32bit
asp.net CLR v2 64bit
asp.net CLR v4 32bit
asp.net CLR v4 64bit
(or even asp.net 1 CLR *shudder*)
The way I understand this works is each of these CLRs/bitness category inherits through the same way down so if in IIS you select the app pool asp.net CLR version 2 and 32 bit it will use all settings from the asp.net CLR v2 32bit machine.config.
For this I have never seen clear guidelines in MS documentation about this but it surely works this way. Can anyway here with detailed knowledge confirm/point me to articles? Is *anything* not this way?
Now I presuming that and in theory you can have 4 active "streams" (or 5 if you include .net 1 CLR) does the change the much documented settings that people use for optimizing asp.net via machine.config.
e.g. (there are loads of these) http://tiredblogger.wordpress.com/2008/09/17/tweaking-net-machineconfig-for-production-deployments/
I am not in the habit of blindly copying settings that I find on blogs/guide without first understanding them.
I thinking not (as maximums will never be reached at one time) but what do others consider?
Cheers,
John
MVP in IIS
Wednesday, October 9, 2013 8:32 AM
All replies
-
User-1426144113 posted
Hi,
Maybe this can help you http://msdn.microsoft.com/en-us/library/ms178685.ASPX
Thanks
Friday, October 11, 2013 2:35 AM -
User-1454326058 posted
Hi Rovastar,
Thanks for your post!
Based on my test for customErrors. I think the machine.config inherits is based on the application pool. For example:
This code:
<customErrors mode="On"> <error statusCode="500" redirect="/Home/Trouble?str=5" /> <error statusCode="400" redirect="/Home/Trouble?str=5" /> <error statusCode="403" redirect="/Home/Trouble?str=5" /> <error statusCode="404" redirect="/Home/Trouble?str=5" /> </customErrors>
Modify the machine.config and add below code. (I don't konw how to set application pool with the 32bit .net framework)
1. Framework64\v4.0.30319\Config\Machine.config; Application pool V4.0. It will redirect to the Trouble page when I use the incorrect URL.
2. Framework64\v2.0.50727\CONFIG\Machine.config; Application pool V2.0. It will redirect to the Trouble page when I use the incorrect URL.
3. Framework64\v2.0.50727\CONFIG\Machine.config; Application pool V4.0. It won't redirect to the Trouble page when I use the incorrect URL.
I suggest that you can do the test by yourself, then you can understand clearly.
Thanks
Best Regards
Friday, October 11, 2013 5:35 AM -
User-234406897 posted
Cheers Tear09 that is the sort of doc I was after:
http://msdn.microsoft.com/en-us/library/ms178685.ASPX
with text like "All .NET Framework applications inherit basic configuration settings and defaults from a file named systemroot\Microsoft .NET\Framework\versionNumber\CONFIG\Machine.config."
However that still leave a bit of ambiguity as it doesn't mention the bitness in there.
We (no idea who 'we' is) probably need to look at tidying up the MSDN documentation to cover this.
Starain chen,
Thanks.
Like I say I am pretty sure how it works from experimentation/knowledge over the years but wanted an official stamp.
For reference to enter 32bit mode - which most of the time is recommended for asp.net apps anyway -
you will change the app pool to contain [enable32bitApponWin64] which will kick that in.
in the applicationhost config set
enable32BitAppOnWin64="true"
(or select the dropdown in IIS app pool advanced settings)Which will use the correct asp.net bitness for the app pool CLR.
Friday, October 11, 2013 7:12 AM -
User-1426144113 posted
Hi,
I did some research, I don't find any other offical documents that detail explanation that.
Thanks
Monday, October 14, 2013 2:51 AM