Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP.NET on a file share (Unverifiable Assembly) 3

Status
Not open for further replies.

link9

Programmer
Nov 28, 2000
3,387
US
Hello all --

I'm putting this out there as sort of a knowledge base article so that the next person won't have to pay Microsoft $250 to solve the problem. There are alot of questions out there on the net with no answers.

After setting IIS (applies to both 5 & 6) to run at "A share located on another computer", rather than "A directory on this computer", a third party assembly I've been using successfully for over a year now began to throw the following configuration exception:

Unverifiable Assembly 'AssemblyName' failed policy check

The problem was that a UNC path is in a different security zone than "My Computer", but furthermore, setting "Local Intranet" and "Trusted Sites" to a "Full Trust" security policy failed to solve the problem (which I still don't completely understand, since that's the zone where my share resides, but I digress).

What eventually had to happen was to open up the .NET framework configuration utility, go under the "Runtime Security Policy" at the "Machine" level, and expand code groups.

Right click the parent code group node, and make a new code group.

Name it something (anything).

Set the definition to "URL"

Specify the url as the root of your website. In my case, it was:
Code:
file://iiscluster/wwwroot

Set the new code group to be "Full Trust"

Voila. Problem solved. Please find below some more detailed descriptions of the process and some other miscellaneous information from an extremely helpful person out of their ASP.NET developer support group.

Here's hoping this saves someone some cash down the road somewhere, and happy coding! :)

-----------------------------------------------
ISSUE:
After moving web content to a UNC share, the following error started to occur:
Configuration Error
Parser Error Message: Unverifiable assembly 'netchartdir_internal' failed policy check.

RESOLUTION:
As the content was no longer local to the machine, a code group needed to be added with sufficient permissions code from the UNC share to execute. ASP.NET permissions can only be restricted at the Application Domain level, so code-groups at any other levels that include the ASP.NET code will need to run with Full trust. The steps to configure this are:

1. From the .NET Framework 1.1 Configuration tool (Administrative Tools), expand the Runtime Security Policy section
2. Navigate to Machine\Code Groups\, right-click on All_Code, and select New to create a new code group
3. Give the code group a name, click Next
4. Select URL as the Condition type from the drop-down list
5. Specify the URL path as:
file://machine2/share/*
6. Click next. For the Permission set, specify Full Trust
7. Click next, then click finish.

Code Access Security restrictions can be added for ASP.NET by modifying the securityPolicy element in the system.web section. The different policy config files for the trust levels are specified in this section. If you want to create a custom policy file for ASP.NET, you can reference it here, with the name of the custom trust level, and the policy file to be applied. This policy file must be added to the \WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG folder

The trust level to be used is specified in <trust level element. Note that this can be included in location tag so it can be specified for individual applications.

penny.gif
penny.gif

The answer to getting answered -- faq855-2992
 
Wow, how did you ever figure all that out??

Chip H.
 
I'm putting this out there as sort of a knowledge base article so that the next person won't have to pay Microsoft $250 to solve the problem

;-)

It actually took them 4 hours and three support professionals to figure it out, so I didn't feel quite so bad after that. I personally blew about 15 hours on it before breaking down and calling them.

I would hope that they'd KB it, but considering the last problem that we actually wound up solving regarding running ASP.NET on a domain controller never got KB'd (even though I posted in numerous Microsoft forums), I figured I'd post it here so that Google will pick it up.

:)
-paul

penny.gif
penny.gif

The answer to getting answered -- faq855-2992
 
As an addendum,

Please note that the proper path to trust all assemblies on the share would be:

Code:
file://iiscluster/wwwroot/*

:)

penny.gif
penny.gif

The answer to getting answered -- faq855-2992
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top