Can't Debug in Visual C# 2008 Express

A

Anders Eriksson

Hello,

I have an project that is created using Visual C# 2005 Pro and I have
imported it into 2008 Express.

Everything works "perfectly" but when I try to debug the project I get
this error message:

---------------------------
Microsoft Visual C# 2008 Express Edition
---------------------------
Error while trying to run project: Unable to start program
'H:\projects\dcMark\bin\Debug\dcMark.exe'.

"Microsoft Visual C# 2008 Express Edition does not support debugging the
code type specified by the project."
 
P

Peter Duniho

Anders said:
Hello,

I have an project that is created using Visual C# 2005 Pro and I have
imported it into 2008 Express.

Everything works "perfectly" but when I try to debug the project I get
this error message:

---------------------------
Microsoft Visual C# 2008 Express Edition
---------------------------
Error while trying to run project: Unable to start program
'H:\projects\dcMark\bin\Debug\dcMark.exe'.

"Microsoft Visual C# 2008 Express Edition does not support debugging the
code type specified by the project."

Impossible to say without a concise-but-complete code example that
reliably demonstrates the problem. In this particular case, the .sln
file is probably a required piece of information.

That said, a quick Google suggests that you may have had unmanaged
debugging turned on in the 2005 project and since that's not supported
in the Express IDE, it fails to work. You may have success changing the
setting in 2005, saving the project, and then upgrading. Alternatively,
look for the setting in the .sln file (I don't know specifically what
it's called, but if you search for "unmanaged" you should find it) and
modify it by hand.

Of course, there may be other non-Express features that prevent
debugging in the Express version. The unmanaged debugging is just one
of them. I don't have a complete list, but you may be able to Google
for one, or just inspect the .sln file directly looking for things that
seem out of place.

Another alternative is to start with an empty project and just copy the
source files into it.

Pete
 
A

Anders Eriksson

Peter said:
That said, a quick Google suggests that you may have had unmanaged
debugging turned on in the 2005 project and since that's not supported
in the Express IDE, it fails to work.
You nailed it!

It seems that unmanaged debugging is the default so if you want to turn
it off you need to add this to the <project>.csproj.user file

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Debug|AnyCPU' ">
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>

Now everything works!

Thank you, I never would have figured this out by myself!

// Anders
 

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