Support for NETCoreSdkRuntimeIdentifier missing
Closed this issue · 3 comments
I use the property NETCoreSdkRuntimeIdentifier
in some of my projects to specify if a 32 or 64 bit comhost.dll
will be generated. However dSPACE.Runtime.InteropServices.BuildTasks.Tools.targets
does not recognize this property and uses the 64-bit version of dscom for a 32-bit comhost.dll
.
I suggest adding a line like this
<_DsComToolsFileDir Condition="'$(NETCoreSdkRuntimeIdentifier)' == 'win-x86'">$(MsBuildThisFileDirectory)..\tools\x86\</_DsComToolsFileDir>
to dSPACE.Runtime.InteropServices.BuildTasks.Tools.targets
. This makes MSBuild to use the right version of dscom if NETCoreSdkRuntimeIdentifier
is set to win-x86
.
I think you also have to add a line to dSPACE.Runtime.InteropServices.BuildTasks.targets
to automatically use the cli version in this case. I assume it will be something like
<_DsComExporterTargetsFile Condition="'$(NETCoreSdkRuntimeIdentifier)' == 'win-x86'">$(MsBuildThisFileDirectory)dSPACE.Runtime.InteropServices.BuildTasks.Tools.targets</_DsComExporterTargetsFile>
According to the Microsoft SDK Documentation this should be the RuntimeIdentifier
property. Searching the web and the Microsoft documentation for NETCoreSdkRuntimeIdentifier
actually results in no hits. Where did you find that property?
I found it in the "official" guide for using COM with .NET. The Additional notes section in Expose .NET Core components to COM shows a blue box marked as important information. It suggests (to my understanding) to use this property to control the bitness of the *.comhost.dll.
In this case, we can use consider this property as well.
(And I learned something new)