HRESULT: 0x80070057 (E_INVALIDARG) 的处理
HRESULT: 0x80070057 (E_INVALIDARG) 的處理
碰到這個(gè)異常的原因很偶然:
現(xiàn)象:
Solution在ReBuild過(guò)程中斷電了,來(lái)電恢復(fù)了,重析編譯整個(gè)Solution不報(bào)錯(cuò),但在瀏覽頁(yè)面時(shí)始終無(wú)法正常瀏覽,而在design的視圖中,每個(gè)aspx的首行代碼都報(bào)錯(cuò)。
解決過(guò)程:
搜索找到很多國(guó)內(nèi)的方案,有的建議重新引用AjaxControlToolkit.dll,還有就是清除asp.net的緩存文件,但都沒(méi)有看到想要的效果,最后在一個(gè)國(guó)外MSDN的貼子(http://social.msdn.microsoft.com/Forums/en-US/csharpide/thread/352c58ec-65d8-4d77-ac7b-d2338c621ef3)中看到種種處理辦法.
相關(guān)方法可以嘗試一下,不能保證所有的方案都能達(dá)到效果,但應(yīng)該也八九不離十了吧。呵呵。
方案1:清空Temporary ASP.NET Files文件夾的文件,重新編譯
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\MyWebService and recompiled and it worked fine. 
這個(gè)方法是網(wǎng)上推薦得最多的方案,好像也可行,也不可行。里面有些文件不能直接刪除,需要通過(guò)特殊手段進(jìn)行刪除。
方案2:卸載系統(tǒng)上所有的Net Framework的版本,IIS,重新安裝Net Framework,IIS
這個(gè)方法好像比較麻煩,而且也不太能確定能達(dá)到解決異常的效果。就網(wǎng)上看到的結(jié)果而言,大多數(shù)人這樣操作并沒(méi)有解決問(wèn)題。這里要注意安裝的順序
?Uninstall .NET (Runtime and SDK)->Uninstall IIS->Install .NET (Runtime and SDK)->Install IIS
方案3:這個(gè)方法我沒(méi)看懂,就不解釋了,貌似比較復(fù)雜Background: The assembly causing me trouble was built in house and I did not have the source code.
Required: You need the Visual Studio SDK for ildasm.exe
Steps:
1.) Disassemble the .dll with the command ildasm.exe AssemblyName.dll /out:AssemblyName.il??
2.) Open the newly created AssemblyName.il with a text editor and search for "permissionset"
3.) Find and delete the following lines:
??.permissionset reqmin 
???????????? = {[mscorlib]System.Security.Permissions.PermissionSetAttribute = {property string 'Name' = string('nobody')}, 
????????????????[mscorlib]System.Security.Permissions.SecurityPermissionAttribute = {property bool 'Execution' = bool(true)}}
4.) Save and rebuild the assembly with the following command: ilasm.exe AssemblyName.il /dll
5.) Throw the new dll in your bin directory or if it's strong named and needed in the GAC you can put it there.
方案4:清除 系統(tǒng)盤:\用戶\用戶名稱\AppData\Local\Temp\Temporary ASP.NET Files里面的文件
C:\Users\\AppData\Local\Temp\Temporary ASP.NET Files
我是用這個(gè)方案搞掂的,恰巧我的是win7的系統(tǒng).不過(guò)好像這個(gè)與方案1配合使用較好.注意:Vista系統(tǒng)與Window7系統(tǒng)這個(gè)尤為適合
-----------------------------我是通過(guò)這個(gè)解決的-------------------------------------------------
?
中文版:未能加載文件或程序集……或它的某一個(gè)依賴項(xiàng)。參數(shù)不正確。 (異常來(lái)自 HRESULT:0×80070057 (E_INVALIDARG))
 English:Could not load file or assembly … The parameter is incorrect … HRESULT: 0×80070057 (E_INVALIDARG)
?
出現(xiàn)的錯(cuò)誤就是如上所述(異常來(lái)自 HRESULT:0×80070057 (E_INVALIDARG)) )
?
解決方法 是 刪除 C:\WINDOWS\Microsoft.NET\Framework\v你網(wǎng)站使用的Framework版本\Temporary ASP.NET files 文件夾。
一點(diǎn)心得,與大家分享。歡迎指正。
轉(zhuǎn)載于:https://www.cnblogs.com/armyant/archive/2012/06/30/2571006.html
總結(jié)
以上是生活随笔為你收集整理的HRESULT: 0x80070057 (E_INVALIDARG) 的处理的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
 
                            
                        - 上一篇: Chrome浏览器小号多开
- 下一篇: 什么是类和对象
