Determine Debug Mode

S

Steven Cheng[MSFT]

Hi Chuck,

Thank you for posting.

Yes, that's a good article describing on ASP.NET 2.0 compilation model and
behavior. As for the compilation/build version, in ASP.NET 2.0, it is
purely depend on the web.config's <compilation debug=xxx> setting. And as
for the "Publish Web Site" ignore the web.config setting mentioned, that
means when we use the "Publish WebSite" to precompile the web appliation,
it always produce release precompilation, however, after publishing it, and
deploy to the target IIS server, if there occurs dynamic compilation
again(in case we've modified the aspx source or the aspx source), the new
dynamic compilation still depend on the web.config <compilation> element's
setting.

Also, if you care about the compilation/build verion, I suggest you can
consider use the aspnet_compiler tool or the web deployment project to
explicitly control the version when perform precompilation for the website
application.

#Visual Studio 2005 Web Deployment Projects
http://msdn.microsoft.com/asp.net/reference/infrastructure/wdp/default.aspx

So, I think for the dynamic compiled assembly's version, you can just rely
on the web.config's <compilation> setting as long as the setting conforms
to the version you choose at the precompilation(when deploy it). To access
the setting programmatically, we can use the .net 2.0's configuration api,
e.g:

protected void Page_Load(object sender, EventArgs e)
{
Configuration config =
WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
CompilationSection compile =
config.SectionGroups["system.web"].Sections["compilation"] as
CompilationSection;

Response.Write("<br/>" + compile.Debug);
}


Hope this helps.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
S

Steven Cheng[MSFT]

Hi Chunk,

How are you doing on this issue? Have you got any further ideas or does my
last reply helps you a little? If there's still anything else we can help,
please feel free to post here.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top