亚洲精品久久久中文字幕-亚洲精品久久片久久-亚洲精品久久青草-亚洲精品久久婷婷爱久久婷婷-亚洲精品久久午夜香蕉

您的位置:首頁技術文章
文章詳情頁

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

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

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

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

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

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

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

解決方法

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

這是我的系統信息。

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>

標簽: web
相關文章:
主站蜘蛛池模板: 免费看一级黄色毛片 | 女人被狂躁的视频免费一一 | 美女黄色在线观看 | 国产免费一区二区三区最新 | 国产hs免费高清在线观看 | 网友自拍一区 | 中国一级做a爱片免费 | 日本免费乱人伦在线观看 | 免费又色又爽的视频国产 | 女人被狂躁的免费视频网站软件 | 国产一区二区三区在线观看精品 | 日韩中文字幕在线播放 | 亚洲女人国产香蕉久久精品 | 黄色录像一级带 | 免费又黄又爽又猛大片午夜 | 久久成人精品免费播放 | 一个人看的ww免费视频 | 欧美一区二区三区国产精品 | a级粗大硬长爽猛视频免费 a级精品国产片在线观看 | 久久久久亚洲精品美女 | 日韩免费看 | 成人黄网18免费观看的网站 | 国产色视频网站 | 国产 欧美 日本 | 鲁大师成人一区二区三区 | 免费可在线观看黄的视频 | 午夜精品一区二区三区在线观看 | 亚洲精品国产成人一区二区 | 亚洲性一级理论片在线观看 | 亚洲不卡影院 | 日韩精品一区二区三区四区 | 免费人成网站尤物在线观看 | 国产精品高清一区二区不卡 | 亚洲精品女同一区二区三区 | 午夜色a大片在线观看免费 午夜色图 | 最新亚洲精品 | 轻轻啪在线视频播放 | 亚洲国产精品va在线观看麻豆 | 午夜一级精品免费毛片 | 国产码欧美日韩高清综合一区 | 免费国产人做人视频在线观看 |