Skip to content

Instantly share code, notes, and snippets.

@xgalaxy
Created December 8, 2019 23:49
Show Gist options
  • Save xgalaxy/a446591dd5da82998799c1c534eae1ba to your computer and use it in GitHub Desktop.
Save xgalaxy/a446591dd5da82998799c1c534eae1ba to your computer and use it in GitHub Desktop.
C# w/ C++ dependency properly
>
>
> You can try this one, it worked for me both from command line and VS
> (msbuild 15.7.177.53362):
> **ProjectReference in csproj:**
>
> ```
> <ProjectReference Include="..\MyVcx\My.vcxproj">
> <Project>{ProjectGuid}</Project>
> <Name>projectname</Name>
> </ProjectReference>
> ```
>
> **In My.vcxproj:** add
>
> ```
> <ItemGroup>
> ....
> <Content Include="$(TargetPath)" >
> <Link>%(Filename)%(Extension)</Link>
> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
> </Content>
> ...
> <!-- You can also add this for PDB -->
> <Content Include="$(TargetPath.Replace('.dll', '.pdb'))" >
> <Link>%(Filename)%(Extension)</Link>
> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
> </Content>
> </ItemGroup>
> ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment