# DEBUG\_POSTFIX (VS\_DOTNET\_TARGET\_FRAMEWORK\_VERSION vs DOTNET\_SDK)

**URL:** https://discourse.cmake.org/t/debug-postfix-vs-dotnet-target-framework-version-vs-dotnet-sdk/11759
**Category:** Code
**Tags:** gen:vs, lang:csharp
**Created:** [September 24, 2024, 10:00am UTC](https://discourse.cmake.org/t/debug-postfix-vs-dotnet-target-framework-version-vs-dotnet-sdk/11759 "2024-09-24T10:00:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![AlamoGrito](https://discourse.cmake.org/user_avatar/discourse.cmake.org/alamogrito/32/3995_2.png) [@AlamoGrito](https://discourse.cmake.org/u/AlamoGrito)
#### Post date: [September 24, 2024, 10:00am UTC](https://discourse.cmake.org/t/debug-postfix-vs-dotnet-target-framework-version-vs-dotnet-sdk/11759/1 "2024-09-24T10:00:47Z")

</div>

I had the need to have C# code compiled to target the Microsoft .Net Framework, .Net6 or .Net8 depending on the CMake option selected. For the MS .Net Framework I’m setting the target property VS\_DOTNET\_TARGET\_FRAMEWORK\_VERSION “v4.8” while the latter two set 2 properties (DOTNET\_SDK “Microsoft.NET.Sdk” and DOTNET\_TARGET\_FRAMEWORK to “net6.0” or “net8.0”). The build works unfortunately in all 3 cases I also was setting DEBUG\_POSTFIX “-d”. Herein lies the problem. The only DLL that actually correctly assigns the “-d” is the 1st one (“v4.8”). Anticipating needing to submit an example, I decide to create a dirt simple “HelloWorld” example which instead of a library creates an executable. This will also serve to determine if the problem is isolated to libraries/assemblies or also applies to executables or not. Well it does. The same problem persists in this simple example.

---

<div class="post-metadata">

### Author: ![AlamoGrito](https://discourse.cmake.org/user_avatar/discourse.cmake.org/alamogrito/32/3995_2.png) [@AlamoGrito](https://discourse.cmake.org/u/AlamoGrito)
#### Post date: [September 24, 2024, 10:40am UTC](https://discourse.cmake.org/t/debug-postfix-vs-dotnet-target-framework-version-vs-dotnet-sdk/11759/2 "2024-09-24T10:40:55Z")

</div>

One additional note that I didn’t notice before. My simple executable example actually produces an executable with the “-d” DEBUG\_POSTFIX when targeting Microsoft .Net Framework (VS\_DOTNET\_TARGET\_FRAMEWORK\_VERSION) and produces a DLL with no DEBUG\_POSTFIX when targeting on of the DOTNET\_SDKs. Haven’t looked at the code base yet but they are either coincidental or related. Thanks.
