SUMMARY
This step-by-step article discusses how to troubleshoot
problems that are related to trust levels.
Managed assemblies are
assigned trust levels that define what resources the assembly, and applications
that use the assembly, will have access to. When an assembly is assigned
permissions that are too restrictive, it does not function correctly. In highly
restrictive environments, this is a common source of problems. This article
describes how to isolate and resolve problems that are related to trust
levels.
Note These steps require you to grant additional privileges to the
assembly. Microsoft recommends that you follow these steps only when you are
confident that the assembly does not pose a security risk.
back to the topIdentify the Current Trust Level Assigned to an Assembly
When an assembly is assigned full trust, security policy
restrictions are not applied to an assembly and you can be confident trust
level is not the source of a problem.
For additional information and to evaluate the
trust level that is assigned to an assembly, click the following article number to view the article in the Microsoft Knowledge Base:
815159
HOW TO: Analyze ASP.NET Web Application Performance by Using the Performance Administration Tool
When the permissions that are assigned to the
assembly are unrestricted, the trust level that is to assigned the assembly is
not causing the problem.
back to the
topDetermine Whether the Trust Level is the Source of the Problem
Trust levels are assigned by using the .NET Framework
Configuration snap-in. A quick way to determine whether restrictive trust
levels are the source of a problem is to temporarily grant full access to the
assembly and determine whether the problem still occurs. To grant full access
to the assembly, follow these steps:
- Click Start, point to
Settings, and then click Control Panel.
- Double-click to open Administrative Tools,
and then double-click to start the Microsoft .NET Framework
Configuration tool.
- Right-click Runtime Security Policy, and
then select Trust Assembly. The Trust An
Assembly wizard appears.
- On the What Would You Like to Modify page,
leave Make changes to this computer selected, and then click
Next.
- On the Which Assembly Do You Want to Trust
page, click Browse and select the assembly that is the source
of the problem. Click Open, and then click
Next.
- On the Choose the Minimum Level of Trust for the
Assembly page, move the slider to Full Trust, and
then click Next.
- On the Completing the Wizard page, click
Finish.
Test the assembly to determine whether the problem still occurs.
The assembly is now free from security policy restrictions, and if the problem
remains, you can be confident that it is not caused by the trust level. When
this is the case, restore the default trust level assigned to the assembly by
repeating the previous steps and clicking (in step 6)
None on
the
Choose The Minimum Level of Trust For the Assembly
page.
back to the
topAdjust the Trust Level
If temporarily assigning full trust to an assembly resolves the
problem, you know that the assembly requires greater trust than is typically
assigned to it. To identify the lowest level of trust that an assembly requires
to execute, assign the lowest trust possible and gradually increase that level
of trust until the assembly executes correctly. To set the appropriate trust
level to the assembly, follow these steps:
- Click Start, point to
Settings, and then click Control Panel.
- Double-click to open Administrative Tools,
and then double-click to start the Microsoft .NET Framework
Configuration tool.
- Right-click Runtime Security Policy, and
then click Trust Assembly. The Trust an
Assembly wizard appears.
- On the What Would You Like to Modify page,
leave Make changes to this computer selected, and then click
Next.
- On the Which Assembly Do You Want to Trust
page, click Browse and select the assembly that is the source
of the problem. Click Open, and then click
Next.
- On the Choose the Minimum Level of Trust for the
Assembly page, move the slider to second position from the bottom, and
then click Next.
- On the Completing the Wizard page, click
Finish.
- Test the assembly.
- If the assembly functions correctly, the assembly
requires the Low trust level to execute.
- If the assembly does not function, repeat steps 2
through 6, and on the Choose the Minimum Level of Trust for the
Assemblypage (step 6), move the slider to third position from the
bottom. If the assembly functions, it requires the High trust level to execute.
- If the assembly does not function when granted Low or High trust levels, it requires Full trust to execute. Repeat steps 2 through 6 and assign Full trust to the assembly.
back to the
topREFERENCES
For additional information, click the following article
numbers to view the articles in the Microsoft Knowledge Base:
315736
HOW TO: Secure an ASP.NET Application by Using Windows Security
315588 HOW TO: Secure an ASP.NET Application Using Client-Side Certificates
815163 HOW TO: Troubleshoot Problems That Are Caused by the .NET Framework Security Configuration
back to the
top