Hi MCM,
As for the compile options in "project properties" and web.config
<compilation> element, they are actually different. To clarify the
difference and how each of them will affect ASP.NET Web application
project's output, it may require us to first go through the difference
between "Web Application project" and the default "Web Site project" of
ASP.NET 2.0 Web application.
In ASP.NET 2.0, it by default use dynamic compilation, which means it
doesn't generate precompiled assemblies in bin dir(like ASP.NET 1.1 /VS
2003). And that's just what you'll get when you create ASP.NET 2.0 web
project via the "Web Site project" model. Later, the ASP.NET team add a
new project model "Web Application project", this provide an ASP.NET 1.1/VS
2003 like model, at development time in IDE, you will be able to
build/compile the website and get precompiled assembly in "bin" dir.
However, the precompile only compile those codebehind classes or component
classes(such as those ones in app_code dir) into assemblies, for aspx or
ascx template, it still require dynamic compile at runtime. Here is a blog
entry that also mentioned some information on this:
#ASP.NET 2.0 - Web Site vs Web Application project
http://blogs.microsoft.co.il/blogs/maordavid/archive/2007/06/03/ASP.NET-2.0-
_2D00_-Web-Site-vs-Web-Application-project.aspx
Now, let's turn to the difference of the two compilation settings you have
seen:
1. the compilation settings/options in "My project" settings, that one is
used for the precompiling you performed via the build menu in visual
studio, which will affect the generated assembly in bin dir(just like other
non-asp.net projects such as winform, console...)
2. the compilation settings in web.config <compilation> element. This
setting control the compilation options/behaviors of the ASP.NET runtime
dynamic compilation (such as those aspx and ascx template which require
being compiled at runtime when they're accessed first time).
Here are some other articles mentioned some useful information related to
the ASP.NET 2.0 dynamic compilation model and something that coupled with
the visual studio IDE:
#Understanding ASP.NET Dynamic Compilation
http://msdn.microsoft.com/en-us/library/ms366723.aspx
#Debug and Release Builds in ASP.NET 2.0
http://odetocode.com/blogs/scott/archive/2005/11/15/2464.aspx
Hope this helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.