VS: ReferenceOutputAssembly has the wrong value for include_external_msproject C# targets referenced from C++/CLI projects
We generate a Visual Studio 19 solution with CMake.
Unfortunately it looks like !3778 (merged) missed a case: We generate a C++/CLI project with CMake that references a C#
.csproj imported via
include_external_msproject. The C# project of course generates an output dll that we want referenced from the C++/CLI project. But CMake sets
false in the
vcxproj file generated for the C++/CLI target. This is incorrect.
It calls cmGeneratorTarget::GetManagedType, where I guess the root of this bug can be found. Obviously A C#
.csproj is managed, but
include_external_msproject defines a
UTILITY target and
GetManagedType aways returns
UTILITY targets, which causes
ReferenceOutputAssembly to be set to false.
This bug was already reported in this comment, but was apparently never turned into an issue.