all groups > visual studio .net debugging > september 2006 >
You're in the

visual studio .net debugging

group:

Managed code not available in debugger attach process when VS2005


Managed code not available in debugger attach process when VS2005 Francesco
9/8/2006 5:54:05 PM
visual studio .net debugging:
I want to debug a service written in c# VS2005.

I know I have to install the service then start it then attach the debugger
to the running process.

Unfortunately when searching for the process I notice that the only
debuggers type available are TSQL and native, no managed code to debug.
Any idea on how this can happen ?

The solution was recently converted from VS2003 and in VS2003 I never had
this kind of problems since the debugger always attached to the process
without any problem.

Thanks in advance for your suggestions.
Francesco

RE: Managed code not available in debugger attach process when VS2005 jetan NO[at]SPAM online.microsoft.com (
9/11/2006 3:05:50 AM
Hi Francesco,

I have performed the following steps to test your scenario:

1. I have tried to use VS2005 to open an old VS.net2003 Windows Serivce
project on my Win2003 SP1 machine.
2. Then I converted this project into VS2005 version.
3. After rebuilding the entire project I started this service in
Services.msc.
4. Click "Debug"->"Attach to Process..." and check "Show processes from all
users" checkbox in left bottom of the dialog.

In the "Type" column of the process list, I can see windows serivce running
with type value: Managed,x86. So it seems that I can not reproduce your
problem.

Normally, I think your problem means that the VS2005 "Attach to process"
dialog auto detects the process code types incorrectly.

Have you tried to use the approach below to workaround your problem?
1. Click the "Select..." button in this dialog above the process listbox
2. Then you may click "Debug these code types:" option in the popup dialog.
3. Select "Managed" code type and click "Ok" button.
4. Select your service and explicitly debug it with the selected "Managed"
code type.

Please feel free to feedback the test result here. Thanks.

If you still can not get this work, I recommend you create a new sample
Windows Service project in VS2005 to give it a test, will the VS2005
"Attach to process" dialog still report the wrong code types? By doing this
test, we can determine if this problem is your project IDE specific.

I look forward to your further feedback. Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
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.
Re: Managed code not available in debugger attach process when VS2005 Francesco
9/11/2006 2:52:56 PM
Hi Jeffrey,
thanks for your suggesttions,

[quoted text, click to view]

Yes I tried this but the attachment fails with access error message.

[quoted text, click to view]

I also tried with a small new service project but nothing.

I also tried to re install VS 2005 with the repair installation command and
this was not successfull too...

At this time only few programs are seen as managed and those who are can be
succesfully attached by the debugger, most of them are not even if I know
they are managed.

Best regards
Francesco

Re: Managed code not available in debugger attach process when VS2005 jetan NO[at]SPAM online.microsoft.com (
9/12/2006 12:00:00 AM
Hi Francesco,

Thanks for your feedback!

This looks like a strange problem. Can you tell the detailed error dialog
message you encountered when you explicitly attach the process? With this
error message, it would be helpful for me to search it in our internal
database. Thanks.

By performing some search, I find a similar record in the bug database,
however, it is closed due to can not be reproduced:
"Unable to attach to the process. There is no managed code running in the
process."
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?Feedba
ckID=97410

Currently, I recommend you create a simplest winform project(not Windows
Service project) and run it, then you may use the VS2005 debugger to attach
this running winform application, will it fail either? Also, have you tried
to reinstall the .Net Framework2.0? Reinstalling framework is very simple,
I recommend you to give it a try.

I will wait for your further information. Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
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.
Re: Managed code not available in debugger attach process when VS2005 Francesco
9/12/2006 3:11:25 PM
[quoted text, click to view]

If I leave the automatic detection of type of code it says (working with a
very short service to test this situation) :
Process:servicedemo.exe
The requested attach was not completely succesfull
Succesfully attached to this types of code : T-SQL (the service perform a
data base connection but I also tried with a simpler one with no database
connection)
Failed to attach to this type of code: Native : Requested operation not
supported

If I force to atach managed code it says :
Unable to attach to the process : denied access

[quoted text, click to view]

Yes all windows forms application can be debbuged correctly, only services
are not.

[quoted text, click to view]

I tried to uninstall and reinstall all developping related applications from
framework 2.0 to visual studio 2005 but nothing.

It is very strange indeed my colleagues can debug services without
difficulty it is only in my workstation something is wrong but I did not
received any errors or warning during the installation, nor cannot find any
registry difference between my registry and my colleagues ones.
It is the first time I fall in case like this, my fear is I will have to
start a new pc from scratch but this will cost me so much time...
Unfortunately I worl most of the time developping our main service so it is
not possible for me to live without the debugger.

Thanks for your further help
Francesco

Re: Managed code not available in debugger attach process when VS2005 jetan NO[at]SPAM online.microsoft.com (
9/13/2006 12:00:00 AM
Hi Francesco,

Thanks for your feedback!

Ok, I assume that you meet this error while attaching to Windows Service
with managed type: "Unable to attach to the process: Access is denied".

I have performed a lot research regarding this error message in both public
and our internal database, however, all the issues related are reported
from remote debugging, so it seems that this issue is not official reported
before.

Due to newsgroup support nature and looking at the complexity of this
issue, it would be done quickly and effectively with direct assistance from
a Microsoft Support Professional through Microsoft Product Support
Services. The PSS engineer may help to obtain the VS2005 process dump or
even do a remote debugging on your machine to find out the root cause. And
I think this is the correct way to troubleshoot this issue.

You can contact Microsoft Product Support directly at 1-(800)936-5800 or by
choosing one of the options listed at
http://www.microsoft.com/services/microsoftservices/supp.mspx

Thanks for your understanding.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
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.
Re: Managed code not available in debugger attach process when VS2005 Francesco
9/13/2006 2:02:46 PM

[quoted text, click to view]

Hi Jeffrey,
I perfectly understand, thanks anyway.

Just as an update on this issue I replaced my system disk using an old disk
image (we use disk image backups) and the problem disappeared.
Now the system is working properly however I will never know what caused
this strange problem, probably some upates or something I installed from the
date of the backup I used to replace the disk.
I cannot remember what I have done from that time... seems not too much.

Re: Managed code not available in debugger attach process when VS2005 jetan NO[at]SPAM online.microsoft.com (
9/14/2006 6:46:18 AM
Hi Francesco,

Cool, thank you for sharing the result with us!

Yes, finding the machine specific root issue for VS IDE normally requires
intensively debugging over the VS2005 process. Also, this debugging usually
requires a deep understanding of VS2005 debugger attach model. These are
not trivial tasks.

Anyway, glad to see you finally resolved this problem. If you need further
help, please feel free to post. Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
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.
AddThis Social Bookmark Button