av一区二区在线观看_亚洲男人的天堂网站_日韩亚洲视频_在线成人免费_欧美日韩精品免费观看视频_久草视

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

Powershell加載dll錯(cuò)誤:Add-Type:無(wú)法加載文件或程序集“ WebDriver.dll”或其依賴項(xiàng)之一不支持操作

瀏覽:92日期:2024-05-16 11:24:46
(adsbygoogle = window.adsbygoogle || []).push({}); 如何解決Powershell加載dll錯(cuò)誤:Add-Type:無(wú)法加載文件或程序集“ WebDriver.dll”或其依賴項(xiàng)之一不支持操作?

如果從Internet下載.DLL,默認(rèn)情況下Powershell將不信任它們。您可以在此處執(zhí)行以下兩項(xiàng)操作之一:

取消阻止內(nèi)容。這是有關(guān)該問題的詳細(xì)說(shuō)明的指南,但實(shí)際上,您只需要右鍵單擊下載的文件,選擇“屬性”,然后在常規(guī)選項(xiàng)卡中單擊“取消阻止”。您可以使用Unblock-Filecmdlet 直接從powershell取消阻止內(nèi)容。更改執(zhí)行策略。這也可能允許您下載的惡意腳本運(yùn)行,因此要小心。

專門查看和取消阻止您信任的內(nèi)容似乎是更好的方法,特別是對(duì)于您的情況,因?yàn)槟坪踔恍枰獔?zhí)行一次并且信任該程序包。

如果那不能解決問題,那么我對(duì)這種類型的錯(cuò)誤的另一種體驗(yàn)是當(dāng)Powershell與程序集沒有.NET運(yùn)行時(shí)版本時(shí)。2.0運(yùn)行.NET 2運(yùn)行時(shí),而問詢者需要某些組件的.NET 4。

您沒有使用相同版本的PS,因此您的里程可能會(huì)有所不同,但是我會(huì)嘗試根據(jù)鏈接的答案創(chuàng)建/編輯配置文件,以支持所使用的DLL的運(yùn)行時(shí)。

解決方法

我想使用seleniumPowerShell,selenium并從http://www.java2s.com/Code/Jar/s/Downloadseleniumremotedriver2350jar.htm下載selenium。當(dāng)我嘗試加載其中一個(gè)dll時(shí),出現(xiàn)錯(cuò)誤。希望有人可以幫助我。

這是我的系統(tǒng)信息。

OS Name: Microsoft Windows 7 EnterpriseOS Version:6.1.7601 Service Pack 1 Build 7601OS Manufacturer: Microsoft Corporation

這是我的PowerShell信息。

PS C:UserstestDownloadsselenium-dotnet-2.35.0net40> $psversiontableName Value---- -----PSVersion 4.0WSManStackVersion 3.0SerializationVersion 1.1.0.1CLRVersion 4.0.30319.18052BuildVersion 6.3.9421.0PSCompatibleVersions {1.0,2.0,3.0,4.0}PSRemotingProtocolVersion 2.2PS C:UserstestDownloadsselenium-dotnet-2.35.0net40>

這是我嘗試加載dll時(shí)遇到的錯(cuò)誤。

PS C:UserstestDownloadsselenium-dotnet-2.35.0net40> Add-Type -Path .WebDriver.dll Add-Type : Could not load file or assembly ’file:///C:UserstestDownloadsselenium-dotnet-2.35.0net40WebDriver.dll’ or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) At line:1 char:1 + Add-Type -Path .WebDriver.dll + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : NotSpecified: (:) [Add-Type],FileLoadException+ FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.AddTypeCommand PS C:UserstestDownloadsselenium-dotnet-2.35.0net40> [reflection.assembly]::LoadFrom('.WebDriver.dll') Exception calling 'LoadFrom' with '1' argument(s): 'Could not load file or assembly ’file:///C:UserstestWebDriver.dll’ or one of its dependencies. The system cannot find the file specified.' At line:1 char:1 + [reflection.assembly]::LoadFrom('.WebDriver.dll') + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : NotSpecified: (:) [],MethodInvocationException+ FullyQualifiedErrorId : FileNotFoundException PS C:UserstestDownloadsselenium-dotnet-2.35.0net40> [reflection.assembly]::LoadFrom('WebDriver.dll') Exception calling 'LoadFrom' with '1' argument(s): 'Could not load file or assembly ’file:///C:UserstestWebDriver.dll’ or one of its dependencies. The system cannot find the file specified.' At line:1 char:1 + [reflection.assembly]::LoadFrom('WebDriver.dll') + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : NotSpecified: (:) [],MethodInvocationException+ FullyQualifiedErrorId : FileNotFoundException PS C:UserstestDownloadsselenium-dotnet-2.35.0net40> [reflection.assembly]::LoadFrom('C:UserstestDownloadsselenium-dotnet-2.35.0net40WebDriver.dll') Exception calling 'LoadFrom' with '1' argument(s): 'Could not load file or assembly ’file:///C:UserstestDownloadsselenium-dotnet-2.35.0net40WebDriver.dll’ or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)' At line:1 char:1 + [reflection.assembly]::LoadFrom('C:UserstestDownloadsselenium-dotnet-2.35.0 ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : NotSpecified: (:) [],MethodInvocationException+ FullyQualifiedErrorId : FileLoadException PS C:UserstestDownloadsselenium-dotnet-2.35.0net40> [reflection.assembly]::LoadFile('C:UserstestDownloadsselenium-dotnet-2.35.0net40WebDriver.dll') Exception calling 'LoadFile' with '1' argument(s): 'An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default,so this load may be dangerous. If this load is not intended to sandbox the assembly,please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.' At line:1 char:1 + [reflection.assembly]::LoadFile('C:UserstestDownloadsselenium-dotnet-2.35.0 ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : NotSpecified: (:) [],MethodInvocationException+ FullyQualifiedErrorId : NotSupportedException PS C:UserstestDownloadsselenium-dotnet-2.35.0net40>

標(biāo)簽: web
相關(guān)文章:
主站蜘蛛池模板: 免费看成人片 | 91免费看片网站 | 黄色a一级片 | 五月婷婷六月天 | 激情综合久久 | 二区三区视频 | 精品福利在线 | 久久久久成人网 | 97caoporn| 日韩久久网 | 中文字幕第三页 | 五月婷婷综合激情 | 亚洲精品乱码久久久久久 | av福利网站 | 日韩精品久久久 | 一级黄色录像带 | 色多多在线观看 | 亚洲欧美天堂 | 午夜国产福利 | 最新中文字幕在线 | 91精品国产99久久久久久红楼 | 黄色精品| 国产专区在线播放 | 中文在线免费观看 | 色片在线 | 日本激情视频 | 中文字幕免费视频 | 亚洲男人天堂网 | 中文字幕黄色 | 国产激情视频 | 免费看一级黄色片 | 四虎四虎 | 国内福利视频 | 激情小说在线视频 | 久久av红桃一区二区小说 | 一区二区视频在线 | 成人午夜又粗又硬又大 | 一级片av | 91av在线免费观看 | www.日本高清 | av免费网|