Hi,
The managed DLL should already be in the build folder since it should be a reference. If it's not, how are you linking/referencing it in your project file?
I'm not sure
$(ProjectDir)
resolves correctly in all situations. I've had more luck with
$(SolutionDir)
or relative paths.
Also in this particular case, if you have the SimConnect SDK installed on the build machine (or accessible via UNC), you could use the environment variable
$(MSFS_SDK)
to locate the DLLs (examples below).
The C SimConnect.dll can be automatically copied into your build folder by using something like this in the project file. Adjust the "Include" path as needed. The "lib" folder referenced below is a subfolder of the current project.
TargetPath
is where the DLL will be copied to, including the file name, relative to the root build directory (so it ends up with all the other binaries).
XML:
<ItemGroup>
<ContentWithTargetPath Include=".\lib\SimConnect.dll">
<!-- <ContentWithTargetPath Include="$(MSFS_SDK)\SimConnect SDK\lib\static\SimConnect.dll"> -->
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>SimConnect.dll</TargetPath>
</ContentWithTargetPath>
</ItemGroup>
For completeness, here's how I have both DLLs listed in a project file:
XML:
<!-- SimConnect libs -->
<ItemGroup>
<Reference Include="Microsoft.FlightSimulator.SimConnect">
<HintPath>.\lib\Microsoft.FlightSimulator.SimConnect.dll</HintPath>
<!-- <HintPath>$(MSFS_SDK)\SimConnect SDK\lib\managed\Microsoft.FlightSimulator.SimConnect.dll</HintPath> -->
<EmbedInteropTypes>false</EmbedInteropTypes>
<Private>true</Private>
</Reference>
<ContentWithTargetPath Include=".\lib\SimConnect.dll">
<!-- <ContentWithTargetPath Include="$(MSFS_SDK)\SimConnect SDK\lib\static\SimConnect.dll"> -->
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>SimConnect.dll</TargetPath>
</ContentWithTargetPath>
</ItemGroup>
HTH,
-Max