.NET Forum / ASP.NET / General / July 2007
VS 2005 Web Application Debug Problems
|
|
Thread rating:  |
AG - 14 Jul 2007 02:37 GMT 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
Steven Cheng[MSFT] - 16 Jul 2007 10:14 GMT 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.
AG - 16 Jul 2007 15:32 GMT 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.
> Hi AG, > [quoted text clipped - 44 lines] > This posting is provided "AS IS" with no warranties, and confers no > rights. Steven Cheng[MSFT] - 18 Jul 2007 14:29 GMT 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.
AG - 18 Jul 2007 15:18 GMT 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.
> Thanks for your reply AG, > [quoted text clipped - 16 lines] > This posting is provided "AS IS" with no warranties, and confers no > rights. Steven Cheng[MSFT] - 20 Jul 2007 09:19 GMT 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.
AG - 23 Jul 2007 01:50 GMT 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.
 Signature
AG Email: discuss at adhdata dot com
> Thanks for your reply AG, > [quoted text clipped - 13 lines] > This posting is provided "AS IS" with no warranties, and confers no > rights. Walter Wang [MSFT] - 23 Jul 2007 03:39 GMT 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 (wawang@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.
AG - 23 Jul 2007 14:38 GMT I just sent it. My email to Steven bounced back anyway.
 Signature AG Email: discuss at adhdata dot com
> Hi AG, > [quoted text clipped - 12 lines] > This posting is provided "AS IS" with no warranties, and confers no > rights. Walter Wang [MSFT] - 24 Jul 2007 07:17 GMT 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 (wawang@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.
AG - 24 Jul 2007 14:23 GMT 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.
 Signature AG Email: discuss at adhdata dot com
> Hi AG, > [quoted text clipped - 28 lines] > This posting is provided "AS IS" with no warranties, and confers no > rights. Walter Wang [MSFT] - 24 Jul 2007 07:18 GMT I forgot to mention that the "Define DEBUG constant" should also be checked.
Regards, Walter Wang (wawang@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.
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|