Skip to content
TheChatArchiveThe Chat Archive
gpt-3.5-turbo-0613· OpenAIAi2 WildChat-4.8M (AI2)

I have a c# project made in visual studio 2019, i have the following post build script:…

  1. User

    I have a c# project made in visual studio 2019, i have the following post build script:

    mkdir (OutDir)x642>NULmkdir(OutDir)x64 2> NUL mkdir (OutDir)x86 2> NUL echo F|xcopy "(ProjectDir)..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\build\net46\x64\SQLite.Interop.dll""(ProjectDir)..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\build\net46\x64\SQLite.Interop.dll" "(OutDir)x64\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""(ProjectDir)..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\build\net46\x86\SQLite.Interop.dll" "(OutDir)x86\SQLite.Interop.dll" /d /y

    It creates two correct files but also two incorrect ones in an incorrect path:

    PRJ\bin\Debug\x64\SQLite.Interop.dll PRJ\bin\Debug\x86\SQLite.Interop.dll PRJ\bin\Debug\bin\Debug\x64\SQLite.Interop.dll PRJ\bin\Debug\bin\Debug\x86\SQLite.Interop.dll

  2. Assistant

    The issue is that the $(OutDir) variable already includes the "bin\Debug" path, so when you are specifying the path in the xcopy command, you are creating an incorrect path by repeating the "bin\Debug" part.

    To fix this, you need to remove the "bin\Debug" part from the xcopy command. Here's the modified script:

    mkdir (OutDir)x642>NULmkdir(OutDir)x64 2> NUL mkdir (OutDir)x86 2> NUL echo F|xcopy "(ProjectDir)..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\build\net46\x64\SQLite.Interop.dll""(ProjectDir)..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\build\net46\x64\SQLite.Interop.dll" "(OutDir)x64" /d /y echo F|xcopy "(ProjectDir)..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\build\net46\x86\SQLite.Interop.dll""(ProjectDir)..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\build\net46\x86\SQLite.Interop.dll" "(OutDir)x86" /d /y

    With this modification, the files will be copied correctly to the (OutDir)x64and(OutDir)x64 and (OutDir)x86 directories without creating additional incorrect paths.