如果我构建到 x86、x64 或任何 CPU,我需要将相应的 SQLite x86/x64 dll 放入 bin 文件夹中。我将在哪里/如何以简单的方式指定它?假设我在 /x86/ 和 /x64/ 文件夹中有 dll。
我在 proj 文件中尝试了这个,但没有效果。该命令在通过“属性”选项卡(无条件)放入构建事件时有效,但在我编辑 xml 文件时无效:
<PropertyGroup>
<PostBuildEvent Condition ="'$(Configuration)|$(Platform)' == 'Release|x86' ">
copy "$(ProjectDir)x86\*.*" "$(TargetDir)"
</PostBuildEvent>
</PropertyGroup>
编辑:
所以这是如何在构建事件“窗口”中放置条件:
If $(PlatformName) == x86 copy "$(ProjectDir)Libs\x86\System.Data.SQLite.dll" "$(TargetDir)System.Data.SQLite.dll"
仍然不确定为什么它不能从 proj 文件中工作。