Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Compilation debug=false in web.config gives errors in application

Reply
Thread Tools

Compilation debug=false in web.config gives errors in application

 
 
Jonas
Guest
Posts: n/a
 
      01-16-2006
Hi,

I've recently found out that I'm supposed to set the debug attribute of the
compilation element in web.config to false in production environments. But
when I do so in my ASP.NET application, I get strange errors. Apparently, a
javascript file that I specify in the vb-code doesn't get called, I and when
I check the source sent to the browser, I can see that the call to the
javascript file is changed so that the filename is prefixed by an
underscore, see first line below. But not all calls are modified, see second
line below.

<script language=javascript src="./WebModules/Scripts/_UsrsDetail.js"
></script>


<script language='javascript'
src='./WebModules/Scripts/cmAddress.js'></script>

The name of the script file failing is the same as the ascx-file calling it
(usrsdetail.asxc).

What happens when I change the debug switch??

TIA

Jonas


 
Reply With Quote
 
 
 
 
Jonas
Guest
Posts: n/a
 
      01-16-2006
I've solved the problem. I use a base class for the ascx control loaded, and
in the page_load event I retrieved the name of the derived ascx by the
sender parameter which apparently got prefixed with an underscore when run
in non-debug mode.

Private Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load

_strUniqueName = sender.ToString.Replace("ASP.", "").Replace("_ascx",
"").Replace("_aspx", "")

Now I use this code instead and it works:

Private Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load

_strUniqueName = Me.GetType.Name.Replace("_ascx", "")

/Jonas

"Jonas" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I've recently found out that I'm supposed to set the debug attribute of

the
> compilation element in web.config to false in production environments. But
> when I do so in my ASP.NET application, I get strange errors. Apparently,

a
> javascript file that I specify in the vb-code doesn't get called, I and

when
> I check the source sent to the browser, I can see that the call to the
> javascript file is changed so that the filename is prefixed by an
> underscore, see first line below. But not all calls are modified, see

second
> line below.
>
> <script language=javascript src="./WebModules/Scripts/_UsrsDetail.js"
> ></script>

>
> <script language='javascript'
> src='./WebModules/Scripts/cmAddress.js'></script>
>
> The name of the script file failing is the same as the ascx-file calling

it
> (usrsdetail.asxc).
>
> What happens when I change the debug switch??
>
> TIA
>
> Jonas
>
>



 
Reply With Quote
 
 
 
 
KevinAndrewLipscomb KevinAndrewLipscomb is offline
Junior Member
Join Date: Dec 2010
Posts: 1
 
      12-02-2010
Jonas,

Thank you for this post! I too was relying on GetType to behave consistently whether debug was true or false in the compilation element in Web.config. I will add that I only saw the problem after moving my app from a pre-IIS7 server to an IIS7 server.

-- Kevin
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apparently genuine code gives compilation errors Luca Risolia C++ 1 10-20-2012 08:06 PM
"Convert to Web Application" caused compilation errors. clintonb ASP .Net 0 06-22-2007 06:08 PM
Help on LNK2019 errors for AMD64 application compilation Madhu Windows 64bit 2 02-21-2006 05:41 AM
Errors, errors, errors Mark Goldin ASP .Net 2 01-17-2004 08:05 PM
split() in String gives compilation error Nishi Bhonsle Java 4 12-23-2003 07:34 PM



Advertisments