Re: Determing security demand for ServiceDescriptionImporter()



You can use this technique in the future to easiliy figure out which permissions are missing:

http://www.leastprivilege.com/ViewingSecurityExceptions.aspx


-----
Dominick Baier (http://www.leastprivilege.com)

Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)

I'm trying to create an instance of
System.Web.Services.Description.ServiceDescriptionImporter (in .Net
1.1) in
an assembly that refuses all permissions and then requests the
individual
ones it needs. Problem is, when I do this, I get a security demand as
soon
as I call the method that contains a call to the constructor for
ServiceDescriptionImporter. When I look in the exception, the
RefusedSet
property is null, so I have no idea which permission it needs. Only
one I
see in the constructor for it are the ones to call
Activator.CreateInstance,
and there are no documented permissions for either the 1.1 or 2.0
version of
the class.
Anyone know what permissions the ctor needs or how I can get an
exception
that actually shows the refused permissionset?


.