创建博客 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

寒剑飘零

一切皆有可能 无穷的力量来自心底对未来的憧憬

 
 
 

日志

 
 

Could not load file or assembly 'safileup, Version=x.x.x.x, Culture=neutral  

2011-06-29 16:07:32|  分类: ASP.NET |  标签: |举报 |字号 订阅

Problem
If you are using FileUp in an ASP.NET application and if you are running this application from a Virtual Directory that is mapped to a network share located on a remote machine, you may get the following error:

HttpException (0x80004005): Could not load file or assembly 'FileUpModule, Version=x.x.x.x , Culture=neutral, PublicKeyToken=f593502af6ee46ae' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)

The error is being thrown for the FileUpModule.dll because it is the first assembly that will be loaded during the execution of the web request. However if you are not using FileUp's HttpModule, then this error will be thrown for the safileup.dll, which will be loaded first, as shown below:

FileLoadException: Could not load file or assembly 'safileup, Version=x.x.x.x, Culture=neutral, PublicKeyToken=f593502af6ee46ae' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)

This is an issue with the .NET Framework's trust level settings on your local machine. The default trust level for the local machine is "Full Trust", whereas for the network share it is not.

Note: This issue is not specific to FileUp. It can occur for any ASP.NET application that is run from a network share.
Solution
This problem can be solved in one of two ways, as explained below:

Granting Full Trust to the Local Intranet zone

On your local machine, you can grant Full Trust to the entire Local Intranet network by following the steps below:
  1. On the local machine go to “Control Panel > Administrative Tools > Microsoft .NET Framework [framework_version] Configuration”. This will launch the "Microsoft .NET Framework [framework_version] Configuration" panel.
  2. On the left under “Console Root” go to “My Computer > Runtime Security Policy”. (See fig.1 below)
  3. On the right pane, under the “Tasks” section go to “Adjust Zone Security”.
  4. Select “Make changes to this computer” and click “Next”.
  5. On the next panel, select the “Local Intranet” zone and set the trust level to “Full Trust”. Then click “Next” and then “Finish”.
  6. Reset IIS by typing "iisreset" at the command line.
  7. Delete the temporary ASP.NET files from "C:\WINDOWS\Microsoft.NET\Framework\[framework_version]\Temporary ASP.NET Files".

Granting Full Trust to the URL of the network share

If you wish to grant Full Trust to only the network share where your application is physically deployed, you can achieve this by following the steps below:
  1. On the local machine go to “Control Panel > Administrative Tools > Microsoft .NET Framework [framework_version] Configuration”.
  2. On the left of the "Microsoft .NET Framework [framework_version] Configuration" panel, under “Console Root” go to “My Computer > Runtime Security Policy > Machine > Code Groups > All_Code”. (See fig.2 below)
  3. Right-click on "All_Code" and select "New" to create a new Code Group.
  4. Into the "Name" field, enter a name to identify your new Code Group. For example: "FileUp_Remote_Access". You can also enter some description for this code group in the "Description" field. Then click "Next".
  5. On the next screen, from the "Choose the condition type for this code group" dropdown list, select "URL". Then enter the UNC URL of the network share that your application's Virtual Directory on your local machine is mapped to in the following structure: \\[remote_machine_name]\[share_directory_name]\*. Then click "Next".
    Note the (*) wildcard notation at the end of the URL. This is for encompassing all the files and folders in your application's directory on the remote machine. For example: " \\myRemoteMachine\FileUp_Remote_Access_Application\* "
  6. On the next screen, select "Use existing permission set" and from the dropdown list select "FullTrust". Then click "Next", and then "Finish".
  7. Reset IIS by typing "iisreset" at the command line.
  8. Delete the temporary ASP.NET files from "C:\WINDOWS\Microsoft.NET\Framework\[framework_version]\Temporary ASP.NET Files".

Fig.1
Could not load file or assembly safileup, Version=x.x.x.x, Culture=neutral - 寒剑飘零 - 寒剑飘零

Fig.2
Could not load file or assembly safileup, Version=x.x.x.x, Culture=neutral - 寒剑飘零 - 寒剑飘零

  评论这张
 
阅读(486)| 评论(0)
|      
推荐

历史上的今天

最近读者

热度

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2014