4

I have solution with .NET Core project and C++ project. .NET Core project uses compiled C++ library via interop and DllImport. How can I configure my build process properly? I would like to have:

  1. Native library is built
  2. Native library is copied to output directory to my main application

Is it possible to do that with project.json and "dotnet build/publish" command?

Alexander Buts
  • 561
  • 1
  • 4
  • 7

1 Answers1

0

Open the property window of your native C++ project. Find Build Events/Post-Build Event/Command Line. Then input the following commands to copy the built dll and pdb files to the output directory of your main application.

xcopy /Y /S "$(OutDir)*.dll" "E:\output_directory_to_my_main_application"
xcopy /Y /S "$(OutDir)*.pdb" "E:\output_directory_to_my_main_application"
zwcloud
  • 4,546
  • 3
  • 40
  • 69