异常:HRESULT: 0x80070057 (E_INVALIDARG) 的处理

碰到这个异常的原因很偶然:

现象:
Solution在ReBuild过程中断电了,来电恢复了,重析编译整个Solution不报错,但在浏览页面时始终无法正常浏览,而在design的视图中,每个aspx的首行代码都报错。

解决过程:

搜索找到很多国内的方案,有的建议重新引用AjaxControlToolkit.dll,还有就是清除asp.net的缓存文件,但都没有看到想要的效果,最后在一个国外MSDN的贴子(http://social.msdn.microsoft.com/Forums/en-US/csharpide/thread/352c58ec-65d8-4d77-ac7b-d2338c621ef3)中看到种种处理办法.

相关方法可以尝试一下,不能保证所有的方案都能达到效果,但应该也八九不离十了吧。呵呵。

方案1:清空Temporary ASP.NET Files文件夹的文件,重新编译

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\MyWebService and recompiled and it worked fine.

这个方法是网上推荐得最多的方案,好像也可行,也不可行。里面有些文件不能直接删除,需要通过特殊手段进行删除。


方案2:卸载系统上所有的Net Framework的版本,IIS,重新安装Net Framework,IIS

这个方法好像比较麻烦,而且也不太能确定能达到解决异常的效果。就网上看到的结果而言,大多数人这样操作并没有解决问题。这里要注意安装的顺序
•Uninstall .NET (Runtime and SDK)->Uninstall IIS->Install .NET (Runtime and SDK)->Install IIS


方案3:这个方法我没看懂,就不解释了,貌似比较复杂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:清除 系统盘:\用户\用户名称\AppData\Local\Temp\Temporary ASP.NET Files里面的文件
C:\Users\\AppData\Local\Temp\Temporary ASP.NET Files


我是用这个方案搞掂的,恰巧我的是win7的系统.不过好像这个与方案1配合使用较好.注意:Vista系统与Window7系统这个尤为适合


一点心得,与大家分享。欢迎指正。



[本日志由 admin 于 2010-08-26 08:43 AM 编辑]
上一篇: Oracle EBS:PO行接收关闭后修改其它行自动打开
下一篇: Oracle:IF语句 Loop循环 Cursor的用法(一)
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags:
相关日志:
评论: 3 | 引用: 0 | 查看次数: 13314
apgk[2016-05-19 11:07 AM | | | 59.57.212.172 | del | 取消审核 | 回复回复]
老兄,我按你的方案4 解决了我机子上的同类问题,方案1对我的机子无效。
小点点[2013-10-24 12:05 AM | | Mail To:song_yongli@126.com | 124.114.98.79 | del | 取消审核 | 回复回复]
老兄,我按你的方案4 解决了我机子上的同类问题,方案1对我的机子无效。
[2013-01-18 09:35 AM | | | 220.178.63.108 | del | 通过审核 | 回复回复]
[此评论正在审核中,只有博主及评论作者可见]
发表评论
昵 称:
密 码: 游客发言不需要密码.
邮 箱: 邮件地址支持Gravatar头像,邮箱地址不会公开.
网 址: 输入网址便于回访.
内 容:
验证码:
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 30 字 | UBB代码 关闭 | [img]标签 关闭