VS 2005 Web Application Debug Problems

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\Tempory 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
 
S

Steven Cheng[MSFT]

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/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.
 
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.
 
S

Steven Cheng[MSFT]

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.
 
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.
 
S

Steven Cheng[MSFT]

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.
 
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.
 
W

Walter Wang [MSFT]

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 ([email protected], 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.
 
W

Walter Wang [MSFT]

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/library/07bysfz2(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/library/etx40x86(VS.80).aspx


Hope this helps.


Regards,
Walter Wang ([email protected], 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.
 
W

Walter Wang [MSFT]

I forgot to mention that the "Define DEBUG constant" should also be checked.


Regards,
Walter Wang ([email protected], 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.
 
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.
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top