Wednesday, September 7, 2016

Parser Error Message: Could not load type 'ApplicationName.Global' on IIS configuration

The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Reference URL:- http://support.microsoft.com/kb/320268
When you use a virtual directory that points to a remote share to host a Microsoft ASP.NET-based application, you may receive an error message that is similar to one of the following:

To resolve this behavior, grant the FullTrust right to the remote share:
  1. On the Web server, open Administrative Tools, and then double-click Microsoft .NET Framework Configuration.
  2. Expand Runtime Security Policy, expand Machine, and then expand Code Groups.
  3. Right-click All_Code, and then click New.
  4. Select Create a new code group. Give your code group a relevant name, such as the name of the applications share. Click Next.
  5. In the Choose the condition type for this code group list, select URL.
  6. In the URL box, type the path of the share in the following format:
    file:////\\computername\sharename\*
    Note Replace computername with the name of the computer that is hosting the remote share. Replace sharename with the name of the share.
  7. Click Next. On the next page, select Use an existing permission set, and then select FullTrust.
  8. Click Next, and then click Finish.
  9. Restart Microsoft Internet Information Services (IIS) to restart the ASP.NET worker process.
If Microsoft .NET Framework Configuration is not displayed under Administrative Tools, you can install the .NET Framework SDK to add Microsoft .NET Framework Configuration. Alternatively, you can run the following command to make the change:


Drive:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\caspol.exe -m -ag 1 -url "file:////\\computername\sharename\*" FullTrust -exclusive on

BY Using command

C:\WINDOWS\Microsoft.NET\Framework>v2.0.50727\CasPol.exe -m -ag 1 -url "file:////\\noc\data\*" FullTrust -exclusive on

AfterRunning above command we can see the below

Microsoft (R) .NET Framework CasPol 2.0.50727.1433
Copyright (c) Microsoft Corporation.  All rights reserved.

The operation you are performing will alter security policy.
Are you sure you want to perform this operation? (yes/no)
yes
Added union code group with "-url" membership condition to the Machine level.
Success

No comments:

Post a Comment