I have a c# project in visual studio 2019, I have set up two post build scripts which…
- User
I have a c# project in visual studio 2019, I have set up two post build scripts which copies the dlls I need to run the program:
mkdir (OutDir)x86 2> NUL echo F|xcopy "(OutDir)x64\SQLite.Interop.dll" /d /y echo F|xcopy "(OutDir)x86\SQLite.Interop.dll" /d /y
- Assistant
The issue most likely occurs because the post-build events are being triggered twice: once during the build process and another time when copying the files. This leads to the creation of duplicate files in the nested "bin\Debug" directory.
To fix this, you can modify your post-build event scripts to copy the files directly into the "bin\Debug" directory instead of creating nested directories. Here's an updated version of your scripts:
echo F|xcopy "$(ProjectDir)..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\build\net46\x64\SQLite.Interop.dll" "$(OutDir)\SQLite.Interop.dll" /d /y echo F|xcopy "$(ProjectDir)..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\build\net46\x86\SQLite.Interop.dll" "$(OutDir)\SQLite.Interop.dll" /d /yBy removing the x64 and x86 subdirectories in the target paths, the files will be copied directly to the "bin\Debug" directory without creating any extra folders.
After making these changes, the correct file paths in the "bin\Debug" directory should be:
Project\bin\Debug\SQLite.Interop.dll (x64 version) Project\bin\Debug\SQLite.Interop.dll (x86 version)