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:
- Native library is built
- 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?
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"