Here’s another side effect of the project less ASP.NET projects in Visual Studio 2005: You loose the ability to use global compiler directives. I have a couple of projects that compile to different targets – one within a framework one just as a standalone and I’m using Compiler directives defined at the project level to cause a handful of changes in these ASP.NET projects.
This is a bummer… I haven’t been able to figure out a way to get around this short of hunting down these directives with Find All and then manually setting flags in these files.
This functionality might actually be there somewhere but I can't find it. I suspect not though because the Debug flag also isn't defined as it is in normal projects.
I haven’t looked at the new Web Project Add-in Microsoft put out a little while back – it probably supports this in 1.1 style project format.
On another note, I wish in general that there’d be a little better support for Includes of some sort. Yes, I’m very glad we don’t have C++ like Include file hell in .NET, which I presume is the reason for the lack of support for them. But it sure would be nice if you could define a project level #include file that contains all your defines and possibly has one global switch that you can control with an #IF statement. So instead setting several of these defines you can just create a couple of different build setups by changing things in one place.
Even better if there was a way to apply some of these on a solution wide level in VS.NET. With my current scenario even in the other ‘real’ projects (Controls, business objects, and general utility projects) each of those need to get those same flags set. So I have to add the defines at each project. I suppose I could create custom Configurations, but that’s a hassle and really seems overkill for something as simple as setting up some include flags.
Other Posts you might also like