By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,665 Members | 1,513 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,665 IT Pros & Developers. It's quick & easy.

VS 2005 Web Application Debug Problems

P: n/a
AG
Hi all,

New install of VS 2005 Pro (SP1) on new machine with Windows XP Pro SP2,
Core 2 Extreme Quad Core processor, 4GB RAM.

Trying to debug a Web Application Project.
I had no problems debugging this same project on my old machine (also
Windows XP SP2), but having problems on the new one.

Initially, when trying to run in debug mode, I got the message
"The following module was built either with optimizations enabled or without
debug information:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temp ory ASP.NET
Files\...\myprojectname.dll'
To debug this module, change its project build configuration to Debug mode.
To supress this message, disable 'Warn if no usercode on launch' debugger
option."
The project is already set to debug mode.

I found a post indicating that 'Enable Just My Code' should be unchecked in
debugging options.

Unchecking it allowed me to start debugging.
However, any properties for any server control or object can not be
evaluated in the immediate or locals windows.
The message is -
'Cannot evaluate expression because the code of the current method is
optimized.'.

Can anyone offer a suggestion on how to get full debugging to work?

TIA

AG
Email: discuss at adhdata dot com


Jul 14 '07 #1
Share this Question
Share on Google+
11 Replies


P: n/a
Hi AG,

From your description, currently when you try debugging an ASP.NET 2.0 Web
application project, you found that the class properties can not be
evaluated in the immedate window and give you the following error,right?

'Cannot evaluate expression because the code of the current method is
optimized.'.

Regarding on this issue, I'd like to confirm the following things:

** whether the problem only occurs on web application project, is it also
occuring through default web site project?

** If this is a common problem occurs in each WAP project and what happen
if you create a very simple WAP project?

If the problem can be repro through a simple typical project, you can send
it to me and let me perform some local tests.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

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

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.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/subscripti...t/default.aspx.

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

Jul 16 '07 #2

P: n/a
AG
Steven,

Thanks for the reply.

I tried a few things.

Simple website project - ok.
Larger website project copied from old machine (using IIS) - ok.

Simple WAP (development server) - ok.
Simple WAP (IIS) - ok.

Larger WAP copied from old machine (IIS) - 'Cannot evaluate expression
because the code of the current method is
optimized.'

Switch same WAP to development server and it is ok.
"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:Ux****************@TK2MSFTNGHUB02.phx.gbl...
Hi AG,

From your description, currently when you try debugging an ASP.NET 2.0 Web
application project, you found that the class properties can not be
evaluated in the immedate window and give you the following error,right?

'Cannot evaluate expression because the code of the current method is
optimized.'.

Regarding on this issue, I'd like to confirm the following things:

** whether the problem only occurs on web application project, is it also
occuring through default web site project?

** If this is a common problem occurs in each WAP project and what happen
if you create a very simple WAP project?

If the problem can be repro through a simple typical project, you can send
it to me and let me perform some local tests.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

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

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.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/subscripti...t/default.aspx.

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

Jul 16 '07 #3

P: n/a
Thanks for your reply AG,

So the problem mainly occur in a complex ASP.NET 2.0 WAP hosted in IIS. As
you said that the same application can be debugged correctly in development
server(WebDev.WebServer.exe), I'm wondering how do you move the WAP into
IIS host? Directly copy the website folder ,configure it as IIS application
virtual dir and use VS 2005 to open it? Have you checked the bin dir to see
whether the PDB files are there.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 18 '07 #4

P: n/a
AG
Steven,

Yes, I copied the files and configured IIS app as you said.
Yes, pdb files are there.

I can access my own code values, etc..
It is system objects like httpcontext, server controls, etc that I can't
access properties/values.

"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:dC**************@TK2MSFTNGHUB02.phx.gbl...
Thanks for your reply AG,

So the problem mainly occur in a complex ASP.NET 2.0 WAP hosted in IIS. As
you said that the same application can be debugged correctly in
development
server(WebDev.WebServer.exe), I'm wondering how do you move the WAP into
IIS host? Directly copy the website folder ,configure it as IIS
application
virtual dir and use VS 2005 to open it? Have you checked the bin dir to
see
whether the PDB files are there.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.

Jul 18 '07 #5

P: n/a
Thanks for your reply AG,

For the problem, currently I haven't any definite clues and I'll have to
perform some local test to dig further on this. Is it possible that you
create a simplified project and sent to me so that I can test it locally?
Also, based on the nature of this issue, it may require complex
troubleshooting process and maybe hard to resolve thoroughly in newsgroup.
But we'll try best to help you on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 20 '07 #6

P: n/a
AG
Steven,
A new project debugs ok, so I can't send you a small one that does not.

However, I did create a brand new web app project with a new name and import
all my files from the old one.

In that case, debugging works as expected.

As a further test, I copied the project file from the new project, renamed
it and replaced the project file in the original project.

Debugging now works as expected in the original project, so the problem does
seem to be in the project file.

While I am now able to debug, I would like to know what the cause of the
problem was, so I sent you an email with the project (proj) files attached.
Hopefully, you can find something.
--

AG
Email: discuss at adhdata dot com

"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:xK**************@TK2MSFTNGHUB02.phx.gbl...
Thanks for your reply AG,

For the problem, currently I haven't any definite clues and I'll have to
perform some local test to dig further on this. Is it possible that you
create a simplified project and sent to me so that I can test it locally?
Also, based on the nature of this issue, it may require complex
troubleshooting process and maybe hard to resolve thoroughly in newsgroup.
But we'll try best to help you on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.

Jul 23 '07 #7

P: n/a
Hi AG,

Since Steven is not in office for several days, I will work with you
instead. Would you please forward the mail to me? Thanks.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
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.

Jul 23 '07 #8

P: n/a
AG
I just sent it. My email to Steven bounced back anyway.

--

AG
Email: discuss at adhdata dot com
"Walter Wang [MSFT]" <wa****@online.microsoft.comwrote in message
news:Wy**************@TK2MSFTNGHUB02.phx.gbl...
Hi AG,

Since Steven is not in office for several days, I will work with you
instead. Would you please forward the mail to me? Thanks.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
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.

Jul 23 '07 #9

P: n/a
Hi AG,

Thanks for the file.

I noticed that the ".._Cant_Debug.vbproj" has "Enable optimizations" turned
on. You can see this by: "My Project" -tab "Compile" -button "Advanced
Compile Options..."
#Advanced Compiler Settings Dialog Box (Visual Basic)
http://msdn2.microsoft.com/en-us/lib...z2(VS.80).aspx
By the way, the "Generate debug info" is set to "pdb-only", although this
should be fine for debugging from IDE, but it displays assembly-language
code only when the running program is attached to the debugger.

#/debug (Visual Basic)
http://msdn2.microsoft.com/en-us/lib...86(VS.80).aspx
Hope this helps.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
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.

Jul 24 '07 #10

P: n/a
I forgot to mention that the "Define DEBUG constant" should also be checked.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
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.

Jul 24 '07 #11

P: n/a
AG
Walter,

That worked.
The strange thing is that on my old machine, I was able to fully debug with
'Enable Optimizations' turned on. I even tried it again to confirm.

Anyway, thanks. Problem solved.

--

AG
Email: discuss at adhdata dot com
"Walter Wang [MSFT]" <wa****@online.microsoft.comwrote in message
news:OW**************@TK2MSFTNGHUB02.phx.gbl...
Hi AG,

Thanks for the file.

I noticed that the ".._Cant_Debug.vbproj" has "Enable optimizations"
turned
on. You can see this by: "My Project" -tab "Compile" -button "Advanced
Compile Options..."
#Advanced Compiler Settings Dialog Box (Visual Basic)
http://msdn2.microsoft.com/en-us/lib...z2(VS.80).aspx
By the way, the "Generate debug info" is set to "pdb-only", although this
should be fine for debugging from IDE, but it displays assembly-language
code only when the running program is attached to the debugger.

#/debug (Visual Basic)
http://msdn2.microsoft.com/en-us/lib...86(VS.80).aspx
Hope this helps.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
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.

Jul 24 '07 #12

This discussion thread is closed

Replies have been disabled for this discussion.