Enterprise Policy error using certificates on V1.1 Framework

From: Jan Jones (dynamitejones_at_hotmail.com)
Date: 01/20/04


Date: 20 Jan 2004 08:40:26 -0800

If you sign an app using a X509 certificate and then set the
enterprise security policy to allow FullTrust to any app signed by the
given publisher, the application cannot access Web Services failing
with the exception below.

The same app under V1.0 with the same policy works fine.

It seems to relate to the execution of code which is runtime compiled

Enterprise Policy as follows:

All_Code - Nothing - LevelFinal
   My_Computer_Zone - Nothing - LevelFinal
      My_Cert - FullTrust - LevelFinal
      Microsoft_Strong_Name - FullTrust - LevelFinal
      ECMA_Strong_Name - FullTrust - LevelFinal

Any ideas?

Jonesy.

************** Exception Text **************
System.Security.Policy.PolicyException: Exception from HRESULT:
0x80131418.
   at System.Reflection.Assembly.nLoadImage(Byte[] rawAssembly, Byte[]
rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.Load(Byte[] rawAssembly, Byte[]
rawSymbolStore, Evidence securityEvidence)
   at System.CodeDom.Compiler.CodeCompiler.FromFileBatch(CompilerParameters
options, String[] fileNames)
   at System.CodeDom.Compiler.CodeCompiler.FromSourceBatch(CompilerParameters
options, String[] sources)
   at System.CodeDom.Compiler.CodeCompiler.FromSource(CompilerParameters
options, String source)
   at System.CodeDom.Compiler.CodeCompiler.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSource(CompilerParameters
options, String source)
   at System.Xml.Serialization.Compiler.Compile()
   at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[]
xmlMappings)
   at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[]
mappings)
   at System.Web.Services.Protocols.SoapClientType..ctor(Type type)
   at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
   at PolicyTest.CurveWebService.Curves..ctor()
   at PolicyTest.Form1.button1_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
PolicyTest
    Assembly Version: 1.0.1480.29363
    Win32 Version: 1.0.1480.29363
    CodeBase: file:///C:/Documents%20and%20Settings/Jones_J/Desktop/Signed.PolicyTest/PolicyTest.exe
----------------------------------------
System.Drawing
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Xml
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
Accessibility
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/accessibility/1.0.5000.0__b03f5f7f11d50a3a/accessibility.dll
----------------------------------------
System.Web.Services
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system.web.services/1.0.5000.0__b03f5f7f11d50a3a/system.web.services.dll
----------------------------------------
System.Web
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system.web/1.0.5000.0__b03f5f7f11d50a3a/system.web.dll
----------------------------------------



Relevant Pages

  • RE: Enterprise Policy error using certificates on V1.1 Framework
    ... Enterprise Policy error using certificates on V1.1 Framework ... | Win32 Version: 1.1.4322.573 ... | CodeBase: ...
    (microsoft.public.dotnet.security)
  • Re: WSE2.0 Security Exception ?
    ... when I reference the network executable. ... I have this issue resolved by running my app from a local drive. ... at System.Configuration.ConfigurationRecord.Evaluate(String configKey) ... Win32 Version: 1.1.4322.2032 ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: WSE2.0 Security Exception ?
    ... when I reference the network executable. ... I have this issue resolved by running my app from a local drive. ... at System.Configuration.ConfigurationRecord.Evaluate(String configKey) ... Win32 Version: 1.1.4322.2032 ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: VCL.NET revisited...
    ... might need to port the application back to Win32. ... app, ... VCL.NET rather than having to learn WinForms -- especially ...
    (borland.public.delphi.non-technical)
  • Re: WSE2.0 Security Exception ?
    ... Anyone have any idea why I would get errors running an app from a network drive, but enabling the app to have Full Trust? ... This problem seems to be specific to 2003, as I can permission the same executable with full trust on a Win2k box without error. ... at System.Configuration.ConfigurationRecord.Evaluate(String configKey) ... Win32 Version: 1.1.4322.2032 ...
    (microsoft.public.dotnet.framework.webservices.enhancements)