Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Mar 02, 2006 05:46 PM by jminond
Mar 01, 2006 09:18 PM|LINK
Inside Microsoft.NET\Framework\v2.0.50727\CONFIG there are two files
web.config and machine.config
I have tried putting compilation debug="true" in both of these, however when i open a site in visual studio 2005, and hit F5 to debug, it says i have to have debug="true" in my app web.config.
In 2003 this was hierarchial, and VS understood that if compilation debug="true" in machine.config, then it would use it, unless overriden.
Why in VS.2005 is this not the case, and how do i get it to work?
Basically, i fi am working with a team of developers, I do not trust them to remove debug="ture" from web.configs that get pushed to production so in .net 1.1 we solved this by having this in the machine.config on developer machines.
Has anyone come accross this and figured out a fix yet?
Steps to reproduce;
1) Edit machine.config and or web.config to add compilation debug="ture"
2) open visual studio 2005, and open a web site either through IIS, or create a new one ( preferably http, not file, this means when you hit debug, it will start as localhost/ and not localhost:2449 or whatever weirdo port.
3) Make sure you DO NOT have debug="true in app web.config, then set a breakpoint somewhere and hit F5... visual studio will now probalby complain to you that debug="true" is not set, and it will offer to set it....
Mar 02, 2006 01:33 PM|LINK
When you set debug=true at machine level, the ASP.NET runtime picks it up automatically in every app, so every app will act as debug.
However, I don’t know whether VisualStudio is able to detect this, which may be why it pops the warning. I'll ask some others to follow up with more info on this.
Mar 02, 2006 01:45 PM|LINK
Hmmm.... this seems strange, you know...
Visual studio is for developers.... (the people who need to debug.).
So imagine this scendario... you work in a company with 20+ developers.
Previously you had machineconfig debug=true on all their pc's and they never ha dto worry, apps where in debug on there pc's but then when pushed to stage and onward, you didnt have to worry about cleaning your web.config.
now.... we would have to that... and it's likely sooner or later someone will start forgetting such a small details and we will end up with debug=true apps on production enviroments, or even worse... when a local sub app conflicts with a allowoveride=false
in a lower config, it just throws an error now !!! why throw an error? why not jsut ignore the setting if it is not allowed to ovveride?
i think Microsoft team did an amazing job on vs 2005, the debugging is great and lots of other fnatastic features... but it seems odd that this was not noticed before.
Could it have to do with the testing i am doing being on windows xp pro and iis 5? perhaps there is some new settings in config hierarchy that iis 5 is unaware of ( although that seems weird, because it should come from framework, not iis, i think? ).
Mar 02, 2006 05:35 PM|LINK
You'll be glad to know that ASP.NET 2.0 has a new feature which addresses exactly this scenario. If you set
<deployment retail="true" />
in machine.config, it disables debugging for all apps, even if they have debug=true. This was done for the very reason that you mention: it's easy to forget that the app has debug=true. All you need to do is turn on deployment mode on the production machine,
and you can feel secure that no app is in debug mode.
You can find more details on
Mar 02, 2006 05:46 PM|LINK
Thanks... tremendous halp, and much appreciated is the quick replies.
again, the asp.net and microsoft teams are doing fantastic jobs.