提问人:znn 提问时间:2/11/2017 最后编辑:znn 更新时间:8/17/2023 访问量:2260
将 Selenium.PhantomJS.WebDriver 与 .Net Core 配合使用
using Selenium.PhantomJS.WebDriver with .Net Core
问:
NuGet 包 Selenium.PhantomJS.WebDriver,在生成项目时,它会将 PhantomJS.exe 复制到 bin 文件夹。使用经典的 .Net,它运行良好。
问题在于,使用.NetCore 这行不通。我可以直接将文件添加到解决方案中,指定 copyOnBuild,但我想避免它。有什么建议吗?
谢谢。
答:
0赞
Berkay Kirmizioglu
8/17/2023
#1
我想到可能有两种解决方法;
如果有机会使用这样的自定义工具,如 CopyLocalLockFileAssemblies,可以在下面的 .csproj 中尝试
<PropertyGroup>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
第二种选择:
xcopy "$(SolutionDir)packages\Selenium.PhantomJS.WebDriver.{version}\tools\phantomjs.exe" "$(TargetDir)"
您可以将此命令放在 postbuild 中。我试过了,但是这些可能会起作用。
评论