RE: Trying to run in partial trust (getting a PolicyException)



It's the output from Permcalc.exe -sandbox mylib.dll

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




"Dominick Baier" wrote:

where does <Sandbox> come from?

---
Dominick Baier, DevelopMentor
http://www.leastprivilege.com

Ok, this is what I got. How do I find out which are a problem in a
partially trusted system?

<Sandbox>
<PermissionSet version="1" class="System.Security.PermissionSet">
<IPermission version="1"
class="System.Security.Permissions.EnvironmentPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
Unrestricted="true" />
<IPermission version="1"
class="System.Security.Permissions.FileIOPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
Unrestricted="true" />
<IPermission version="1"
class="System.Security.Permissions.ReflectionPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
Flags="MemberAccess" />
<IPermission version="1"
class="System.Security.Permissions.RegistryPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
Unrestricted="true" />
<IPermission version="1"
class="System.Security.Permissions.SecurityPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
Flags="UnmanagedCode, Execution, ControlThread, ControlEvidence" />
<IPermission Window="SafeSubWindows" Clipboard="OwnClipboard"
version="1" class="System.Security.Permissions.UIPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<IPermission version="1"
class="System.Security.Permissions.KeyContainerPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
Unrestricted="true" />
<IPermission version="1" class="System.Net.SocketPermission,
System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
Unrestricted="true" />
<IPermission version="1" class="System.Net.DnsPermission, System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
Unrestricted="true" />
</PermissionSet>
</Sandbox>
Cubicle Wars - http://www.windwardreports.com/film.htm

"Steven Cheng[MSFT]" wrote:

Hello Dave,

From your description, you have changed the trust level of your
ASP.NET web application(to partial trust) and now you'll encounter
.net CAS permission error when try running the application ,correct?

Based on the exception callstack and message you provided, the
problem is caused by the following assembly:

==============
Could not load file or assembly 'WindwardReports,
Version=4.1.35.0, Culture=neutral, PublicKeyToken=34ffe15f4bbb8e53'
or one
of
its dependencies.
==============
The minimal requested permissions are violating the host
environment's trust level. I think you can check the permission
through the following two steps:

** Verify your current ASP.NET application's trust level(high or
medium or...) and find that level's policy file(in framework's config
folder ----C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG) and
verify whether that assembly contains any code that violate the CAS
permissionset allowed in that policy.

** for assembly, .net 2.0 provide the permcalc.exe tool which can
help verify the minimum permission sandbox in which an application
can run.

#Permission Calculator Tool (Permcalc.exe)
http://msdn2.microsoft.com/en-us/library/ms165077(VS.80).aspx

e.g.

Permcalc.exe -sandbox mylib.dll

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.asp
x#notif ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues where an initial response from the community or a Microsoft
Support Engineer within 1 business day is acceptable. Please note
that each follow up response may take approximately 2 business days
as the support professional working with you may need further
investigation to reach the most efficient resolution. The offering is
not appropriate for situations that require urgent, real-time or
phone-based interactions or complex project analysis and dump
analysis issues. Issues of this nature are best handled working with
a dedicated Microsoft Support Engineer by contacting Microsoft
Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.




.



Relevant Pages

  • RE: Trying to run in partial trust (getting a PolicyException)
    ... This policy file is very informative for analyzie the CAS permission issue ... ControlThread, ControlPrincipal, RemotingConfiguration" /> ... class="System.Security.Permissions.EnvironmentPermission, mscorlib, ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Faillure to run .NET 2.0 app from UNC
    ... Could you also try to check the minimum grand set of permission your ... class="System.Security.Permissions.EnvironmentPermission, mscorlib, ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework)
  • RE: Trying to run in partial trust (getting a PolicyException)
    ... where does <Sandbox> come from? ... class="System.Security.Permissions.EnvironmentPermission, mscorlib, ... .net CAS permission error when try running the application,correct? ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • RE: Trying to run in partial trust (getting a PolicyException)
    ... RequestMinimum and the two items below were the only uses in all of my code. ... class="System.Security.Permissions.EnvironmentPermission, mscorlib, ... I think you can check the permission ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • MOSS Search crashing after Infrastructure Update
    ... permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, ... at System.Security.CodeAccessSecurityEngine.Check(Object demand, ... id, String name, String provisioningAssemblyWithoutExtention, String ...
    (microsoft.public.sharepoint.windowsservices)