国产成人精品久久免费动漫-国产成人精品天堂-国产成人精品区在线观看-国产成人精品日本-a级毛片无码免费真人-a级毛片毛片免费观看久潮喷

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

Powershell加載dll錯誤:Add-Type:無法加載文件或程序集“ WebDriver.dll”或其依賴項之一。不支持操作

瀏覽:147日期:2024-04-21 13:56:28
如何解決Powershell加載dll錯誤:Add-Type:無法加載文件或程序集“ WebDriver.dll”或其依賴項之一。不支持操作?

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

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

專門查看和取消阻止您信任的內(nèi)容似乎是更好的方法,特別是對于您的情況,因為您似乎只需要執(zhí)行一次并且信任該程序包。

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

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

解決方法

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

這是我的系統(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時遇到的錯誤。

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)文章:
主站蜘蛛池模板: 久久久久久福利 | 国产成人精品视频 | 欧美色老头oldvideo | 深夜爽爽爽福利动态图 | 欧美高清在线视频在线99精品 | 九九久久久久久久爱 | 久久亚洲精品中文字幕第一区 | 精品一精品国产一级毛片 | 国产一区二区三区免费观看 | 在线看欧美成人中文字幕视频 | 亚洲国产精品综合久久 | 亚洲欧美色视频 | 国产乱理片在线观看夜 | 波多野结衣在线免费视频 | 精品玖玖玖视频在线观看 | 成人男女网18免费看 | 失禁h啪肉尿出来高h健身房 | 成人123 | 农村寡妇偷毛片一级 | 亚洲视频在线观看免费视频 | 国产精品久久国产三级国电话系列 | 黄色三级毛片 | 国产免费怡红院视频 | 成人毛片免费观看视频 | 中文在线日韩 | 国产免费一区不卡在线 | 日本人成在线视频免费播放 | 国产精品莉莉欧美自在线线 | 欧美大片在线播放 | 美国免费三片在线观看 | 成人中文字幕一区二区三区 | 在线观看成年视频 | 一级毛片视频免费观看 | 中文乱码字幕午夜无线观看 | 全免费a级毛片免费毛视频 全午夜免费一级毛片 | 成年人视频在线免费看 | 萌白酱国产一区 | 日韩精品国产一区 | 九九视频免费在线观看 | 激情视频一区 | 美国毛片一级视频在线aa |