我正在使用一些库,并且添加了对该库 dll 的引用,并将“复制本地”设置为 true。
但我想将dll的位置更改为exe文件夹中的子文件夹,而不是与exe一起。
这怎么可能?
thanks
Update:
我使用了以下构建后事件 [如 Jon Skeet 推荐]
move /y $(TargetDir)\System.Data.SqlServerCe.dll $(TargetDir)\Lib\SqlSrvCe\System.Data.SqlServerCe.dll
您的 .exe 需要一个 .config 文件,以便更改探测路径。子目录没问题,只需使用<probing>
元素,其 privatePath 属性是相对文件夹名称。
但请注意,将 DLL 放在该位置时,IDE 不会提供任何帮助。您将需要一个构建后事件来创建文件夹(如有必要),并且 xcopy 是其中的 DLL。像这样的事情:
if not exist "$(TargetDir)mumble" mkdir "$(TargetDir)mumble"
xcopy /d /y "$(TargetDir)something.dll" "$(TargetDir)mumble"
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)