Home     Products      Support      Corporate     Sign In 
Support Knowledge Base, Article 1273
Product
FileUp
Version
5
Title
Error: Could not load file or assembly ... Failed to grant minimum permission requests
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

Fig.2

Created : 2/15/2008 2:07:07 PM (last modified : 2/15/2008 2:07:07 PM)
Rate this article!
Comments