Appdomain.CreateDomain() throws Security Exception from a Managed

From: Praisy (Praisy_at_discussions.microsoft.com)
Date: 06/20/05


Date: Mon, 20 Jun 2005 04:56:12 -0700

Hi,
The following exception occured when I tried to create an appdomain.
"System.Security.SecurityException: Request for the permission of type
'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
   at System.AppDomain.CreateDomain(String friendlyName, Evidence
securityInfo, AppDomainSetup info)
   at StoredProcedures.SPInsertTest()
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.Permissions.SecurityPermission
The Zone of the assembly that failed was:
MyComputer "

Let me explain what I have done.

1.I've created a class library by name TestApp which has a config file. I
have method called Readconfig which reads from the config and puts the value
in the file in some location. the readconfig method is called in the
constructor of this class.

2. I've created an exe which refers the above calss libray and creates the
object of the class present in it.

3. I've created a Managed stored procedure using the SQLServerProject in the
whidbey. The stored procedure has the following code.

            AppDomainSetup ads = new AppDomainSetup();
            ads.ApplicationBase = @"C:\SPTestExe";
            ads.ConfigurationFile = @"C:\SPTestExe\TestAppExe.exe.config";

            AppDomain ad = AppDomain.CreateDomain("TestApp", null, ads);
            ad.ExecuteAssembly(@"c:\SPTestExe\TestAppExe.exe");
       
when I install this stored procedure in yukon and run it, I get the above
mentioned exception.

Not able to trace out the reason.

Any help is gratly appreciated.
Thanks in advance,



Relevant Pages

  • Appdomain.CreateDomain throws SecurityException
    ... The following exception occured when I tried to create an appdomain. ... Request for the permission of type ... the readconfig method is called in the ... I've created a Managed stored procedure using the SQLServerProject in the ...
    (microsoft.public.dotnet.security)
  • Re: security/strong name/zones clarification needed
    ... this AppDomain needs to be setup before your assembly can be loaded, ... Now your assembly is executing with the FullTrust permission set. ... When the call stack is initiated, ... All my assemblies are strong named. ...
    (microsoft.public.dotnet.security)
  • Re: Stored procedure to drop and create table for end user
    ... > having permission on the database that they should not (like delete rows and ... > such) so the only thing the end user has access to is execute permission on ... > back with select permission not granted on a table the stored procedure is ... > tables (which i dont like doing considering some of them have sensative data ...
    (microsoft.public.sqlserver.programming)
  • Re: Adjusting security setting to run an embedded windows control in IE
    ... Should I connect back to the server only using port 80? ... Changing security permission by the client is not an option ... > AppDomain that it runs your code in, that AppDomain is created based on ... > zone has been given Full Trust). ...
    (microsoft.public.dotnet.security)
  • Re: EXECUTE permission denied on object... uh?
    ... connecting with doesn't have permission to execute the Stored Procedure ... runBehavior, SqlCommand cmdHandler, SqlDataReader ...
    (microsoft.public.dotnet.framework.aspnet)