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.
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.