CppSharp icon indicating copy to clipboard operation
CppSharp copied to clipboard

enable dotnet portable debug database in *.csproj

Open qingfengxia opened this issue 4 years ago • 6 comments
trafficstars

by default visual studio will generate pdb files that can not be used in vscode to debug with dotnet core (tested dotnet 3.1).

This extract xml snippet can enable debug. not sure if this work with monoDevelop.

qingfengxia avatar Mar 10 '21 19:03 qingfengxia

CLA assistant check
All CLA requirements met.

dnfadmin avatar Mar 10 '21 19:03 dnfadmin

This seems OK, but since the MSBuild properties are common to all projects and configurations, I think you could add them to this shared property group block: https://github.com/mono/CppSharp/blob/master/Directory.Build.props#L4

tritao avatar Mar 10 '21 19:03 tritao

ah, I am not familiar with C# build system, not even know there is such an option for all projects. not sure if dotnet build will look into that https://github.com/mono/CppSharp/blob/master/Directory.Build.props#L4

qingfengxia avatar Mar 10 '21 21:03 qingfengxia

ah, I am not familiar with C# build system, not even know there is such an option for all projects. not sure if dotnet build will look into that https://github.com/mono/CppSharp/blob/master/Directory.Build.props#L4

That file is automatically included by MSBuild.

So all you should need is to add:

    <DebugType>portable</DebugType>
    <DebugSymbols>true</DebugSymbols>

Around the line I linked previously.

tritao avatar Mar 10 '21 21:03 tritao

Can you make the requested changes to merge this one?

tritao avatar Mar 23 '21 15:03 tritao

@qingfengxia you just need to edit this line: https://github.com/mono/CppSharp/blob/af275edb55f4628266259ac7c19ea5a786b47aa6/Directory.Build.props#L42

josetr avatar Jun 08 '21 22:06 josetr