problems attaching to explorer.exe process

G

Guest

I am using VS2003 to create a C# dll that uses shell namespace extensions.

I need to debug my code but it is running in the explorer.exe process and
when I open my namespace extension from My Computer so its running, then try
to attach to the explorer.exe process with VS2003 I get the message....

"Unable to attach to the process."

Any suggestions are really welcome because I really need to see what is
happening inside my code.

Thanks,
 
N

Nicholas Paldino [.NET/C# MVP]

Phil,

Why not set up your project so that it runs the explorer.exe process
when debugging? You can set this up on the projects page. This might work
for you.
 
M

Mattias Sjögren

I am using VS2003 to create a C# dll that uses shell namespace extensions.

I need to debug my code but it is running in the explorer.exe process and
when I open my namespace extension from My Computer so its running, then try
to attach to the explorer.exe process with VS2003 I get the message....

It's not recommended to create NSEs (or other components loaded by the
shell) in managed code. Native code is the only way to go.


Mattias
 
G

Guest

I found a solution to my attaching to process problem....

The explorer process will load the com interop layer in the latest version
of .net installed on the machine (in my case 2.0) even though my dll is then
running in version 1.1... so you can't attach the debugger process from VS
2003 onto the 2.0 CLR.

SO, here is how I got around it...

Create a file called explorer.exe.config with settings to use .net 1.1,
Explorer will then run the com interop layer in version 1.1 which is the same
version as my dll and I can debug.

Hope this helps others who experience this problem!

Phil
 

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

Top