# How to specify PDB file generation for C#/CSharp projects using CMake

**URL:** https://discourse.cmake.org/t/how-to-specify-pdb-file-generation-for-c-csharp-projects-using-cmake/4009
**Category:** Code
**Created:** [September 1, 2021, 12:31pm UTC](https://discourse.cmake.org/t/how-to-specify-pdb-file-generation-for-c-csharp-projects-using-cmake/4009 "2021-09-01T12:31:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![StefanBattmer](https://discourse.cmake.org/user_avatar/discourse.cmake.org/stefanbattmer/32/1578_2.png) [@StefanBattmer](https://discourse.cmake.org/u/StefanBattmer)
#### Post date: [September 1, 2021, 12:31pm UTC](https://discourse.cmake.org/t/how-to-specify-pdb-file-generation-for-c-csharp-projects-using-cmake/4009/1 "2021-09-01T12:31:42Z")

</div>

Hi there,

is there a way to tell CMake to set the `DebugType` property for C# projects using CMake? What I would like to be able to do is to set it to pdbonly for Release Builds since without that my code coverage analysis does no longer work. As far as I understood this doesn’t seem to be possible…

I know (and tried) the `VS_GLOBAL_` property but (as the name implies) this adds to the `<PropertyGroup Label="Globals">` node while I need to add a

```auto
<DebugType>pdbonly</DebugType>

```

to the

```auto
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">

```

node.

So something like this:

```auto
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
  ...
  <DebugType>pdbonly</DebugType>
  ...
</PropertyGroup>

```

Cheers,

Stefan
