Falied to grand permission when host a .NET control in IE web page

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Falied to grand permission when host a .NET control in IE web page

    I have a winform control hosted in IE web page. When the client side is
    Win2000, the page works ok. However, when I view the page from Win2003, it
    shows nothing. I could find some error message from the "Temporary Internet
    Files" folder :

    ***** IEHOST Error Log (Tuesday, 06 July 2004 14:14) *****



    URL: [url]http://10.147.130.245/dwmweb/Flag.DWM.dll[/url]
    Zone: 3
    Assembly Name: Flag.DWM.dll
    Type Name: Flag.DWM.TabDWMControl



    ----- Thrown Exception -----


    System.Reflection.TargetInvocationException: Exception has been thrown by
    the target of an invocation. ---> System.IO.FileLoadException: Failed to
    grant required minimum permissions to assembly 'MagicLibrary,
    Version=1.7.4.0, Culture=neutral, PublicKeyToken=null'.
    File name: 'MagicLibrary, Version=1.7.4.0, Culture=neutral,
    PublicKeyToken=null' ---> System.Security.Policy.PolicyException: Required
    permissions can not be acquired.
    at System.Security.SecurityManager.ResolvePolicy(Evid ence evidence,
    PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset,
    PermissionSet& denied, Boolean checkExecutionPermission)
    at System.Security.SecurityManager.ResolvePolicy(Evid ence evidence,
    PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset,
    PermissionSet& denied, Int32& grantedIsUnrestricted, Boolean
    checkExecutionPermission)
    at Flag.DWM.TabDWMControl..ctor()
    --- End of inner exception stack trace ---
    at System.AppDomain.CreateComInstanceFrom(String assemblyFile, String
    typeName, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
    at Microsoft.IE.SecureFactory.CreateInstanceWithSecur ity(Int32 dwFlag,
    Int32 dwZone, String pURL, String uniqueIdString, String link, String
    licenses)

    Pages from other web site can be correctly viewed in my Win2003 machine.I
    checked the MagicLibrary.dll and found it has a lot of interop code to
    access User32.dll and GDI32.dll. Is that the reason? How to configure my
    machine to view the page?Thanks!



    Lei Jiang Guest

  2. Similar Questions and Discussions

    1. Can only connect to home page after host switch
      We switched hosting companies for a client site. We set up a new Contribute connection key but we can only edit the home page. Any of the other...
    2. Passign Javascript From User Control to Parent(host) Page
      Good Afternoon I am hoping for some help for a problem i am struggling with. I am using a Parent Page to Dynamically load my user Controls based...
    3. Permission denied on ASP Page
      Hi, last week I moved the folder of my Intranet application to another disk of the same server. After this change all the ASP page return this...
    4. Finding grand total
      Hi, I have the following table: NAME varchar(10) V1 integer V2 integer V3 integer Values in the table are like:
    5. user control making changes to host page
      After you add the user control, look into the Page.FindControls method. The UserControl has a reference to the page it is on through Page. HTH,...
  3. #2

    Default Re: Falied to grand permission when host a .NET control in IE web page

    Lei,

    On your windows 2003 box, you have to set permissions
    for 'http://10.147.130.245/dwmweb/Flag.DWM.dll' to execute on
    your system under .NET Framework.

    First have a look at:
    [url]http://support.microsoft.com/?id=311295[/url]

    and do this:

    <quote>
    1.. Start the .NET Framework configuration tool, Mscorcfg.msc.
    2.. Expand each element in the following path:
    My Computer/Runtime Security Policy/Machine/Code Groups/All
    Code/LocalIntranet_Zone

    Right-click the LocalIntranet_Zone node, and then click new.
    3.. Name the new code group TestVBNetCtrl, and then click Next to display
    the Choose a condition type dialog box.
    4.. Select URL as the condition type, and then type [url]http://ServerName/*[/url] in
    the URL box.
    5.. Click Next to proceed to the Assign a Permission Set to the Code Group
    dialog box.
    6.. Click Use existing permission set, click FullTrust, and then click
    Next to finish.
    </quote>

    --
    Hope this helps,
    Zeeshan Mustafa, MCSD


    "Lei Jiang" <code@263.net> wrote in message
    news:ekD9uLyYEHA.3688@TK2MSFTNGP12.phx.gbl...
    > I have a winform control hosted in IE web page. When the client side is
    > Win2000, the page works ok. However, when I view the page from Win2003, it
    > shows nothing. I could find some error message from the "Temporary
    Internet
    > Files" folder :
    >
    > ***** IEHOST Error Log (Tuesday, 06 July 2004 14:14) *****
    >
    >
    >
    > URL: [url]http://10.147.130.245/dwmweb/Flag.DWM.dll[/url]
    > Zone: 3
    > Assembly Name: Flag.DWM.dll
    > Type Name: Flag.DWM.TabDWMControl
    >
    >
    >
    > ----- Thrown Exception -----
    >
    >
    > System.Reflection.TargetInvocationException: Exception has been thrown by
    > the target of an invocation. ---> System.IO.FileLoadException: Failed to
    > grant required minimum permissions to assembly 'MagicLibrary,
    > Version=1.7.4.0, Culture=neutral, PublicKeyToken=null'.
    > File name: 'MagicLibrary, Version=1.7.4.0, Culture=neutral,
    > PublicKeyToken=null' ---> System.Security.Policy.PolicyException: Required
    > permissions can not be acquired.
    > at System.Security.SecurityManager.ResolvePolicy(Evid ence evidence,
    > PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset,
    > PermissionSet& denied, Boolean checkExecutionPermission)
    > at System.Security.SecurityManager.ResolvePolicy(Evid ence evidence,
    > PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset,
    > PermissionSet& denied, Int32& grantedIsUnrestricted, Boolean
    > checkExecutionPermission)
    > at Flag.DWM.TabDWMControl..ctor()
    > --- End of inner exception stack trace ---
    > at System.AppDomain.CreateComInstanceFrom(String assemblyFile, String
    > typeName, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
    > at Microsoft.IE.SecureFactory.CreateInstanceWithSecur ity(Int32 dwFlag,
    > Int32 dwZone, String pURL, String uniqueIdString, String link, String
    > licenses)
    >
    > Pages from other web site can be correctly viewed in my Win2003 machine.I
    > checked the MagicLibrary.dll and found it has a lot of interop code to
    > access User32.dll and GDI32.dll. Is that the reason? How to configure my
    > machine to view the page?Thanks!
    >
    >
    >



    M. Zeeshan Mustafa Guest

  4. #3

    Default Re: Falied to grand permission when host a .NET control in IE web page


    Of course I have configured that. It can't solve the problem.

    All the Win2000 client can run it after being configured(just as stated in
    the document), but Win2003 client failed in the same situation.

    "M. Zeeshan Mustafa" <zeeshan@no-spm.please.zeeshan.net> дÈëÏûÏ¢
    news:eJhD7b1YEHA.2844@TK2MSFTNGP12.phx.gbl...
    > Lei,
    >
    > On your windows 2003 box, you have to set permissions
    > for 'http://10.147.130.245/dwmweb/Flag.DWM.dll' to execute on
    > your system under .NET Framework.
    >
    > First have a look at:
    > [url]http://support.microsoft.com/?id=311295[/url]
    >
    > and do this:
    >
    > <quote>
    > 1.. Start the .NET Framework configuration tool, Mscorcfg.msc.
    > 2.. Expand each element in the following path:
    > My Computer/Runtime Security Policy/Machine/Code Groups/All
    > Code/LocalIntranet_Zone
    >
    > Right-click the LocalIntranet_Zone node, and then click new.
    > 3.. Name the new code group TestVBNetCtrl, and then click Next to
    display
    > the Choose a condition type dialog box.
    > 4.. Select URL as the condition type, and then type [url]http://ServerName/*[/url]
    in
    > the URL box.
    > 5.. Click Next to proceed to the Assign a Permission Set to the Code
    Group
    > dialog box.
    > 6.. Click Use existing permission set, click FullTrust, and then click
    > Next to finish.
    > </quote>
    >
    > --
    > Hope this helps,
    > Zeeshan Mustafa, MCSD
    >
    >
    > "Lei Jiang" <code@263.net> wrote in message
    > news:ekD9uLyYEHA.3688@TK2MSFTNGP12.phx.gbl...
    > > I have a winform control hosted in IE web page. When the client side is
    > > Win2000, the page works ok. However, when I view the page from Win2003,
    it
    > > shows nothing. I could find some error message from the "Temporary
    > Internet
    > > Files" folder :
    > >
    > > ***** IEHOST Error Log (Tuesday, 06 July 2004 14:14) *****
    > >
    > >
    > >
    > > URL: [url]http://10.147.130.245/dwmweb/Flag.DWM.dll[/url]
    > > Zone: 3
    > > Assembly Name: Flag.DWM.dll
    > > Type Name: Flag.DWM.TabDWMControl
    > >
    > >
    > >
    > > ----- Thrown Exception -----
    > >
    > >
    > > System.Reflection.TargetInvocationException: Exception has been thrown
    by
    > > the target of an invocation. ---> System.IO.FileLoadException: Failed to
    > > grant required minimum permissions to assembly 'MagicLibrary,
    > > Version=1.7.4.0, Culture=neutral, PublicKeyToken=null'.
    > > File name: 'MagicLibrary, Version=1.7.4.0, Culture=neutral,
    > > PublicKeyToken=null' ---> System.Security.Policy.PolicyException:
    Required
    > > permissions can not be acquired.
    > > at System.Security.SecurityManager.ResolvePolicy(Evid ence evidence,
    > > PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset,
    > > PermissionSet& denied, Boolean checkExecutionPermission)
    > > at System.Security.SecurityManager.ResolvePolicy(Evid ence evidence,
    > > PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset,
    > > PermissionSet& denied, Int32& grantedIsUnrestricted, Boolean
    > > checkExecutionPermission)
    > > at Flag.DWM.TabDWMControl..ctor()
    > > --- End of inner exception stack trace ---
    > > at System.AppDomain.CreateComInstanceFrom(String assemblyFile, String
    > > typeName, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
    > > at Microsoft.IE.SecureFactory.CreateInstanceWithSecur ity(Int32
    dwFlag,
    > > Int32 dwZone, String pURL, String uniqueIdString, String link, String
    > > licenses)
    > >
    > > Pages from other web site can be correctly viewed in my Win2003
    machine.I
    > > checked the MagicLibrary.dll and found it has a lot of interop code to
    > > access User32.dll and GDI32.dll. Is that the reason? How to configure my
    > > machine to view the page?Thanks!
    > >
    > >
    > >
    >
    >
    >
    >

    Lei Jiang Guest

  5. #4

    Default Re: Falied to grand permission when host a .NET control in IE web page

    The problem is as it clearly states in error message that permissions
    by Flag.DWM.dll cannot be granted (inherited) to MagicLibrary.

    Only fully trusted callers (assemblies) can use strong named assemblies,
    unless AllowPartiallyTrustedCallersAttribute is used in sn assemblies
    to allow partially trusted callers.

    If you give partial trust to your assembly, and your
    assembly is calling an assembly which is Full-Trust only assembly,
    you may receive exception.

    Try giving full-trust permissions to MagicLibrary explicitly...

    --
    Hope this helps,
    Zeeshan Mustafa, MCSD


    "Lei Jiang" <code@263.net> wrote in message
    news:%23KR$3$1YEHA.2216@TK2MSFTNGP10.phx.gbl...
    >
    > Of course I have configured that. It can't solve the problem.
    >
    > All the Win2000 client can run it after being configured(just as stated in
    > the document), but Win2003 client failed in the same situation.
    >
    > "M. Zeeshan Mustafa" <zeeshan@no-spm.please.zeeshan.net> дÈëÏûÏ¢
    > news:eJhD7b1YEHA.2844@TK2MSFTNGP12.phx.gbl...
    > > Lei,
    > >
    > > On your windows 2003 box, you have to set permissions
    > > for 'http://10.147.130.245/dwmweb/Flag.DWM.dll' to execute on
    > > your system under .NET Framework.
    > >
    > > First have a look at:
    > > [url]http://support.microsoft.com/?id=311295[/url]
    > >
    > > and do this:
    > >
    > > <quote>
    > > 1.. Start the .NET Framework configuration tool, Mscorcfg.msc.
    > > 2.. Expand each element in the following path:
    > > My Computer/Runtime Security Policy/Machine/Code Groups/All
    > > Code/LocalIntranet_Zone
    > >
    > > Right-click the LocalIntranet_Zone node, and then click new.
    > > 3.. Name the new code group TestVBNetCtrl, and then click Next to
    > display
    > > the Choose a condition type dialog box.
    > > 4.. Select URL as the condition type, and then type
    [url]http://ServerName/*[/url]
    > in
    > > the URL box.
    > > 5.. Click Next to proceed to the Assign a Permission Set to the Code
    > Group
    > > dialog box.
    > > 6.. Click Use existing permission set, click FullTrust, and then click
    > > Next to finish.
    > > </quote>
    > >
    > > --
    > > Hope this helps,
    > > Zeeshan Mustafa, MCSD
    > >
    > >
    > > "Lei Jiang" <code@263.net> wrote in message
    > > news:ekD9uLyYEHA.3688@TK2MSFTNGP12.phx.gbl...
    > > > I have a winform control hosted in IE web page. When the client side
    is
    > > > Win2000, the page works ok. However, when I view the page from
    Win2003,
    > it
    > > > shows nothing. I could find some error message from the "Temporary
    > > Internet
    > > > Files" folder :
    > > >
    > > > ***** IEHOST Error Log (Tuesday, 06 July 2004 14:14) *****
    > > >
    > > >
    > > >
    > > > URL: [url]http://10.147.130.245/dwmweb/Flag.DWM.dll[/url]
    > > > Zone: 3
    > > > Assembly Name: Flag.DWM.dll
    > > > Type Name: Flag.DWM.TabDWMControl
    > > >
    > > >
    > > >
    > > > ----- Thrown Exception -----
    > > >
    > > >
    > > > System.Reflection.TargetInvocationException: Exception has been thrown
    > by
    > > > the target of an invocation. ---> System.IO.FileLoadException: Failed
    to
    > > > grant required minimum permissions to assembly 'MagicLibrary,
    > > > Version=1.7.4.0, Culture=neutral, PublicKeyToken=null'.
    > > > File name: 'MagicLibrary, Version=1.7.4.0, Culture=neutral,
    > > > PublicKeyToken=null' ---> System.Security.Policy.PolicyException:
    > Required
    > > > permissions can not be acquired.
    > > > at System.Security.SecurityManager.ResolvePolicy(Evid ence evidence,
    > > > PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset,
    > > > PermissionSet& denied, Boolean checkExecutionPermission)
    > > > at System.Security.SecurityManager.ResolvePolicy(Evid ence evidence,
    > > > PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset,
    > > > PermissionSet& denied, Int32& grantedIsUnrestricted, Boolean
    > > > checkExecutionPermission)
    > > > at Flag.DWM.TabDWMControl..ctor()
    > > > --- End of inner exception stack trace ---
    > > > at System.AppDomain.CreateComInstanceFrom(String assemblyFile,
    String
    > > > typeName, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
    > > > at Microsoft.IE.SecureFactory.CreateInstanceWithSecur ity(Int32
    > dwFlag,
    > > > Int32 dwZone, String pURL, String uniqueIdString, String link, String
    > > > licenses)
    > > >
    > > > Pages from other web site can be correctly viewed in my Win2003
    > machine.I
    > > > checked the MagicLibrary.dll and found it has a lot of interop code to
    > > > access User32.dll and GDI32.dll. Is that the reason? How to configure
    my
    > > > machine to view the page?Thanks!
    > > >
    > > >
    > > >
    > >
    > >
    > >
    > >
    >
    >



    M. Zeeshan Mustafa Guest

  6. #5

    Default Re: Falied to grand permission when host a .NET control in IE web page


    Thanks. But none of these assemblies is strong named assembly.

    BTW: How to give full-trust permissions to MagicLibrary explicitly?




    "M. Zeeshan Mustafa" <zeeshan@no-spm.please.zeeshan.net> дÈëÏûÏ¢
    news:#o6qvc2YEHA.556@tk2msftngp13.phx.gbl...
    > The problem is as it clearly states in error message that permissions
    > by Flag.DWM.dll cannot be granted (inherited) to MagicLibrary.
    >
    > Only fully trusted callers (assemblies) can use strong named assemblies,
    > unless AllowPartiallyTrustedCallersAttribute is used in sn assemblies
    > to allow partially trusted callers.
    >
    > If you give partial trust to your assembly, and your
    > assembly is calling an assembly which is Full-Trust only assembly,
    > you may receive exception.
    >
    > Try giving full-trust permissions to MagicLibrary explicitly...
    >
    > --
    > Hope this helps,
    > Zeeshan Mustafa, MCSD
    >
    >
    > "Lei Jiang" <code@263.net> wrote in message
    > news:%23KR$3$1YEHA.2216@TK2MSFTNGP10.phx.gbl...
    > >
    > > Of course I have configured that. It can't solve the problem.
    > >
    > > All the Win2000 client can run it after being configured(just as stated
    in
    > > the document), but Win2003 client failed in the same situation.
    > >
    > > "M. Zeeshan Mustafa" <zeeshan@no-spm.please.zeeshan.net> дÈëÏûÏ¢
    > > news:eJhD7b1YEHA.2844@TK2MSFTNGP12.phx.gbl...
    > > > Lei,
    > > >
    > > > On your windows 2003 box, you have to set permissions
    > > > for 'http://10.147.130.245/dwmweb/Flag.DWM.dll' to execute on
    > > > your system under .NET Framework.
    > > >
    > > > First have a look at:
    > > > [url]http://support.microsoft.com/?id=311295[/url]
    > > >
    > > > and do this:
    > > >
    > > > <quote>
    > > > 1.. Start the .NET Framework configuration tool, Mscorcfg.msc.
    > > > 2.. Expand each element in the following path:
    > > > My Computer/Runtime Security Policy/Machine/Code Groups/All
    > > > Code/LocalIntranet_Zone
    > > >
    > > > Right-click the LocalIntranet_Zone node, and then click new.
    > > > 3.. Name the new code group TestVBNetCtrl, and then click Next to
    > > display
    > > > the Choose a condition type dialog box.
    > > > 4.. Select URL as the condition type, and then type
    > [url]http://ServerName/*[/url]
    > > in
    > > > the URL box.
    > > > 5.. Click Next to proceed to the Assign a Permission Set to the Code
    > > Group
    > > > dialog box.
    > > > 6.. Click Use existing permission set, click FullTrust, and then
    click
    > > > Next to finish.
    > > > </quote>
    > > >
    > > > --
    > > > Hope this helps,
    > > > Zeeshan Mustafa, MCSD
    > > >
    > > >
    > > > "Lei Jiang" <code@263.net> wrote in message
    > > > news:ekD9uLyYEHA.3688@TK2MSFTNGP12.phx.gbl...
    > > > > I have a winform control hosted in IE web page. When the client side
    > is
    > > > > Win2000, the page works ok. However, when I view the page from
    > Win2003,
    > > it
    > > > > shows nothing. I could find some error message from the "Temporary
    > > > Internet
    > > > > Files" folder :
    > > > >
    > > > > ***** IEHOST Error Log (Tuesday, 06 July 2004 14:14) *****
    > > > >
    > > > >
    > > > >
    > > > > URL: [url]http://10.147.130.245/dwmweb/Flag.DWM.dll[/url]
    > > > > Zone: 3
    > > > > Assembly Name: Flag.DWM.dll
    > > > > Type Name: Flag.DWM.TabDWMControl
    > > > >
    > > > >
    > > > >
    > > > > ----- Thrown Exception -----
    > > > >
    > > > >
    > > > > System.Reflection.TargetInvocationException: Exception has been
    thrown
    > > by
    > > > > the target of an invocation. ---> System.IO.FileLoadException:
    Failed
    > to
    > > > > grant required minimum permissions to assembly 'MagicLibrary,
    > > > > Version=1.7.4.0, Culture=neutral, PublicKeyToken=null'.
    > > > > File name: 'MagicLibrary, Version=1.7.4.0, Culture=neutral,
    > > > > PublicKeyToken=null' ---> System.Security.Policy.PolicyException:
    > > Required
    > > > > permissions can not be acquired.
    > > > > at System.Security.SecurityManager.ResolvePolicy(Evid ence
    evidence,
    > > > > PermissionSet reqdPset, PermissionSet optPset, PermissionSet
    denyPset,
    > > > > PermissionSet& denied, Boolean checkExecutionPermission)
    > > > > at System.Security.SecurityManager.ResolvePolicy(Evid ence
    evidence,
    > > > > PermissionSet reqdPset, PermissionSet optPset, PermissionSet
    denyPset,
    > > > > PermissionSet& denied, Int32& grantedIsUnrestricted, Boolean
    > > > > checkExecutionPermission)
    > > > > at Flag.DWM.TabDWMControl..ctor()
    > > > > --- End of inner exception stack trace ---
    > > > > at System.AppDomain.CreateComInstanceFrom(String assemblyFile,
    > String
    > > > > typeName, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
    > > > > at Microsoft.IE.SecureFactory.CreateInstanceWithSecur ity(Int32
    > > dwFlag,
    > > > > Int32 dwZone, String pURL, String uniqueIdString, String link,
    String
    > > > > licenses)
    > > > >
    > > > > Pages from other web site can be correctly viewed in my Win2003
    > > machine.I
    > > > > checked the MagicLibrary.dll and found it has a lot of interop code
    to
    > > > > access User32.dll and GDI32.dll. Is that the reason? How to
    configure
    > my
    > > > > machine to view the page?Thanks!
    > > > >
    > > > >
    > > > >
    > > >
    > > >
    > > >
    > > >
    > >
    > >
    >
    >
    >
    >

    Lei Jiang Guest

  7. #6

    Default Re: Falied to grand permission when host a .NET control in IE web page

    Give full trust permissions to your assembly, and it should
    be inherited by MagicLibrary.

    --
    Hope this helps,
    Zeeshan Mustafa, MCSD


    "Lei Jiang" <code@263.net> wrote in message
    news:uAJv0w2YEHA.1356@TK2MSFTNGP09.phx.gbl...
    >
    > Thanks. But none of these assemblies is strong named assembly.
    >
    > BTW: How to give full-trust permissions to MagicLibrary explicitly?
    >
    >
    >
    >
    > "M. Zeeshan Mustafa" <zeeshan@no-spm.please.zeeshan.net> дÈëÏûÏ¢
    > news:#o6qvc2YEHA.556@tk2msftngp13.phx.gbl...
    > > The problem is as it clearly states in error message that permissions
    > > by Flag.DWM.dll cannot be granted (inherited) to MagicLibrary.
    > >
    > > Only fully trusted callers (assemblies) can use strong named assemblies,
    > > unless AllowPartiallyTrustedCallersAttribute is used in sn assemblies
    > > to allow partially trusted callers.
    > >
    > > If you give partial trust to your assembly, and your
    > > assembly is calling an assembly which is Full-Trust only assembly,
    > > you may receive exception.
    > >
    > > Try giving full-trust permissions to MagicLibrary explicitly...
    > >
    > > --
    > > Hope this helps,
    > > Zeeshan Mustafa, MCSD
    > >
    > >
    > > "Lei Jiang" <code@263.net> wrote in message
    > > news:%23KR$3$1YEHA.2216@TK2MSFTNGP10.phx.gbl...
    > > >
    > > > Of course I have configured that. It can't solve the problem.
    > > >
    > > > All the Win2000 client can run it after being configured(just as
    stated
    > in
    > > > the document), but Win2003 client failed in the same situation.
    > > >
    > > > "M. Zeeshan Mustafa" <zeeshan@no-spm.please.zeeshan.net> дÈëÏûÏ¢
    > > > news:eJhD7b1YEHA.2844@TK2MSFTNGP12.phx.gbl...
    > > > > Lei,
    > > > >
    > > > > On your windows 2003 box, you have to set permissions
    > > > > for 'http://10.147.130.245/dwmweb/Flag.DWM.dll' to execute on
    > > > > your system under .NET Framework.
    > > > >
    > > > > First have a look at:
    > > > > [url]http://support.microsoft.com/?id=311295[/url]
    > > > >
    > > > > and do this:
    > > > >
    > > > > <quote>
    > > > > 1.. Start the .NET Framework configuration tool, Mscorcfg.msc.
    > > > > 2.. Expand each element in the following path:
    > > > > My Computer/Runtime Security Policy/Machine/Code Groups/All
    > > > > Code/LocalIntranet_Zone
    > > > >
    > > > > Right-click the LocalIntranet_Zone node, and then click new.
    > > > > 3.. Name the new code group TestVBNetCtrl, and then click Next to
    > > > display
    > > > > the Choose a condition type dialog box.
    > > > > 4.. Select URL as the condition type, and then type
    > > [url]http://ServerName/*[/url]
    > > > in
    > > > > the URL box.
    > > > > 5.. Click Next to proceed to the Assign a Permission Set to the
    Code
    > > > Group
    > > > > dialog box.
    > > > > 6.. Click Use existing permission set, click FullTrust, and then
    > click
    > > > > Next to finish.
    > > > > </quote>
    > > > >
    > > > > --
    > > > > Hope this helps,
    > > > > Zeeshan Mustafa, MCSD
    > > > >
    > > > >
    > > > > "Lei Jiang" <code@263.net> wrote in message
    > > > > news:ekD9uLyYEHA.3688@TK2MSFTNGP12.phx.gbl...
    > > > > > I have a winform control hosted in IE web page. When the client
    side
    > > is
    > > > > > Win2000, the page works ok. However, when I view the page from
    > > Win2003,
    > > > it
    > > > > > shows nothing. I could find some error message from the "Temporary
    > > > > Internet
    > > > > > Files" folder :
    > > > > >
    > > > > > ***** IEHOST Error Log (Tuesday, 06 July 2004 14:14) *****
    > > > > >
    > > > > >
    > > > > >
    > > > > > URL: [url]http://10.147.130.245/dwmweb/Flag.DWM.dll[/url]
    > > > > > Zone: 3
    > > > > > Assembly Name: Flag.DWM.dll
    > > > > > Type Name: Flag.DWM.TabDWMControl
    > > > > >
    > > > > >
    > > > > >
    > > > > > ----- Thrown Exception -----
    > > > > >
    > > > > >
    > > > > > System.Reflection.TargetInvocationException: Exception has been
    > thrown
    > > > by
    > > > > > the target of an invocation. ---> System.IO.FileLoadException:
    > Failed
    > > to
    > > > > > grant required minimum permissions to assembly 'MagicLibrary,
    > > > > > Version=1.7.4.0, Culture=neutral, PublicKeyToken=null'.
    > > > > > File name: 'MagicLibrary, Version=1.7.4.0, Culture=neutral,
    > > > > > PublicKeyToken=null' ---> System.Security.Policy.PolicyException:
    > > > Required
    > > > > > permissions can not be acquired.
    > > > > > at System.Security.SecurityManager.ResolvePolicy(Evid ence
    > evidence,
    > > > > > PermissionSet reqdPset, PermissionSet optPset, PermissionSet
    > denyPset,
    > > > > > PermissionSet& denied, Boolean checkExecutionPermission)
    > > > > > at System.Security.SecurityManager.ResolvePolicy(Evid ence
    > evidence,
    > > > > > PermissionSet reqdPset, PermissionSet optPset, PermissionSet
    > denyPset,
    > > > > > PermissionSet& denied, Int32& grantedIsUnrestricted, Boolean
    > > > > > checkExecutionPermission)
    > > > > > at Flag.DWM.TabDWMControl..ctor()
    > > > > > --- End of inner exception stack trace ---
    > > > > > at System.AppDomain.CreateComInstanceFrom(String assemblyFile,
    > > String
    > > > > > typeName, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
    > > > > > at Microsoft.IE.SecureFactory.CreateInstanceWithSecur ity(Int32
    > > > dwFlag,
    > > > > > Int32 dwZone, String pURL, String uniqueIdString, String link,
    > String
    > > > > > licenses)
    > > > > >
    > > > > > Pages from other web site can be correctly viewed in my Win2003
    > > > machine.I
    > > > > > checked the MagicLibrary.dll and found it has a lot of interop
    code
    > to
    > > > > > access User32.dll and GDI32.dll. Is that the reason? How to
    > configure
    > > my
    > > > > > machine to view the page?Thanks!
    > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    > >
    > >
    >
    >

    M. Zeeshan Mustafa Guest

  8. #7

    Default Re: Falied to grand permission when host a .NET control in IE web page

    I have give full-trust permissions to the site where the assemblies come
    from, that's not enough?

    The biggest problem is : why the applications runs in Win2000 smoothly, but
    can't be load in Win2003?


    "M. Zeeshan Mustafa" <zeeshan@no-spm.please.zeeshan.net> дÈëÏûÏ¢
    news:Oc8XX72YEHA.1652@TK2MSFTNGP09.phx.gbl...
    > Give full trust permissions to your assembly, and it should
    > be inherited by MagicLibrary.
    >
    > --
    > Hope this helps,
    > Zeeshan Mustafa, MCSD
    >
    >
    > "Lei Jiang" <code@263.net> wrote in message
    > news:uAJv0w2YEHA.1356@TK2MSFTNGP09.phx.gbl...
    > >
    > > Thanks. But none of these assemblies is strong named assembly.
    > >
    > > BTW: How to give full-trust permissions to MagicLibrary explicitly?
    > >
    > >
    > >
    > >
    > > "M. Zeeshan Mustafa" <zeeshan@no-spm.please.zeeshan.net> дÈëÏûÏ¢
    > > news:#o6qvc2YEHA.556@tk2msftngp13.phx.gbl...
    > > > The problem is as it clearly states in error message that permissions
    > > > by Flag.DWM.dll cannot be granted (inherited) to MagicLibrary.
    > > >
    > > > Only fully trusted callers (assemblies) can use strong named
    assemblies,
    > > > unless AllowPartiallyTrustedCallersAttribute is used in sn assemblies
    > > > to allow partially trusted callers.
    > > >
    > > > If you give partial trust to your assembly, and your
    > > > assembly is calling an assembly which is Full-Trust only assembly,
    > > > you may receive exception.
    > > >
    > > > Try giving full-trust permissions to MagicLibrary explicitly...
    > > >
    > > > --
    > > > Hope this helps,
    > > > Zeeshan Mustafa, MCSD
    > > >
    > > >
    > > > "Lei Jiang" <code@263.net> wrote in message
    > > > news:%23KR$3$1YEHA.2216@TK2MSFTNGP10.phx.gbl...
    > > > >
    > > > > Of course I have configured that. It can't solve the problem.
    > > > >
    > > > > All the Win2000 client can run it after being configured(just as
    > stated
    > > in
    > > > > the document), but Win2003 client failed in the same situation.
    > > > >
    > > > > "M. Zeeshan Mustafa" <zeeshan@no-spm.please.zeeshan.net> дÈëÏûÏ¢
    > > > > news:eJhD7b1YEHA.2844@TK2MSFTNGP12.phx.gbl...
    > > > > > Lei,
    > > > > >
    > > > > > On your windows 2003 box, you have to set permissions
    > > > > > for 'http://10.147.130.245/dwmweb/Flag.DWM.dll' to execute on
    > > > > > your system under .NET Framework.
    > > > > >
    > > > > > First have a look at:
    > > > > > [url]http://support.microsoft.com/?id=311295[/url]
    > > > > >
    > > > > > and do this:
    > > > > >
    > > > > > <quote>
    > > > > > 1.. Start the .NET Framework configuration tool, Mscorcfg.msc.
    > > > > > 2.. Expand each element in the following path:
    > > > > > My Computer/Runtime Security Policy/Machine/Code Groups/All
    > > > > > Code/LocalIntranet_Zone
    > > > > >
    > > > > > Right-click the LocalIntranet_Zone node, and then click new.
    > > > > > 3.. Name the new code group TestVBNetCtrl, and then click Next
    to
    > > > > display
    > > > > > the Choose a condition type dialog box.
    > > > > > 4.. Select URL as the condition type, and then type
    > > > [url]http://ServerName/*[/url]
    > > > > in
    > > > > > the URL box.
    > > > > > 5.. Click Next to proceed to the Assign a Permission Set to the
    > Code
    > > > > Group
    > > > > > dialog box.
    > > > > > 6.. Click Use existing permission set, click FullTrust, and then
    > > click
    > > > > > Next to finish.
    > > > > > </quote>
    > > > > >
    > > > > > --
    > > > > > Hope this helps,
    > > > > > Zeeshan Mustafa, MCSD
    > > > > >
    > > > > >
    > > > > > "Lei Jiang" <code@263.net> wrote in message
    > > > > > news:ekD9uLyYEHA.3688@TK2MSFTNGP12.phx.gbl...
    > > > > > > I have a winform control hosted in IE web page. When the client
    > side
    > > > is
    > > > > > > Win2000, the page works ok. However, when I view the page from
    > > > Win2003,
    > > > > it
    > > > > > > shows nothing. I could find some error message from the
    "Temporary
    > > > > > Internet
    > > > > > > Files" folder :
    > > > > > >
    > > > > > > ***** IEHOST Error Log (Tuesday, 06 July 2004 14:14) *****
    > > > > > >
    > > > > > >
    > > > > > >
    > > > > > > URL: [url]http://10.147.130.245/dwmweb/Flag.DWM.dll[/url]
    > > > > > > Zone: 3
    > > > > > > Assembly Name: Flag.DWM.dll
    > > > > > > Type Name: Flag.DWM.TabDWMControl
    > > > > > >
    > > > > > >
    > > > > > >
    > > > > > > ----- Thrown Exception -----
    > > > > > >
    > > > > > >
    > > > > > > System.Reflection.TargetInvocationException: Exception has been
    > > thrown
    > > > > by
    > > > > > > the target of an invocation. ---> System.IO.FileLoadException:
    > > Failed
    > > > to
    > > > > > > grant required minimum permissions to assembly 'MagicLibrary,
    > > > > > > Version=1.7.4.0, Culture=neutral, PublicKeyToken=null'.
    > > > > > > File name: 'MagicLibrary, Version=1.7.4.0, Culture=neutral,
    > > > > > > PublicKeyToken=null' --->
    System.Security.Policy.PolicyException:
    > > > > Required
    > > > > > > permissions can not be acquired.
    > > > > > > at System.Security.SecurityManager.ResolvePolicy(Evid ence
    > > evidence,
    > > > > > > PermissionSet reqdPset, PermissionSet optPset, PermissionSet
    > > denyPset,
    > > > > > > PermissionSet& denied, Boolean checkExecutionPermission)
    > > > > > > at System.Security.SecurityManager.ResolvePolicy(Evid ence
    > > evidence,
    > > > > > > PermissionSet reqdPset, PermissionSet optPset, PermissionSet
    > > denyPset,
    > > > > > > PermissionSet& denied, Int32& grantedIsUnrestricted, Boolean
    > > > > > > checkExecutionPermission)
    > > > > > > at Flag.DWM.TabDWMControl..ctor()
    > > > > > > --- End of inner exception stack trace ---
    > > > > > > at System.AppDomain.CreateComInstanceFrom(String
    assemblyFile,
    > > > String
    > > > > > > typeName, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
    > > > > > > at
    Microsoft.IE.SecureFactory.CreateInstanceWithSecur ity(Int32
    > > > > dwFlag,
    > > > > > > Int32 dwZone, String pURL, String uniqueIdString, String link,
    > > String
    > > > > > > licenses)
    > > > > > >
    > > > > > > Pages from other web site can be correctly viewed in my Win2003
    > > > > machine.I
    > > > > > > checked the MagicLibrary.dll and found it has a lot of interop
    > code
    > > to
    > > > > > > access User32.dll and GDI32.dll. Is that the reason? How to
    > > configure
    > > > my
    > > > > > > machine to view the page?Thanks!
    > > > > > >
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Lei Jiang Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139