M
Marco
I have a .NET control embedded in Internet Explorer. Right now I am
loading the control in a Local Intranet Zone, meaning that
http://localhost/MyWebPage.htm has the embedded control. I have:
1) Strong Named my control
2) added [assembly: System.Security.AllowPartiallyTrustedCallers]
attribute to my AssemblyInfo.cs file
3) created a custom Code Group under "All_Code" in Machine Runtime
Security Policy
4) set the "Membership Condition" of my code group to be "Strong Name" and
imported the file (with and without the Name and Version)
5) set the "Permission Set" to be "FullTrust"
All to not have my control load up correctly. This is the IEDebug output:
Microsoft.IE.SecureFactory: Trying to create instance of type
http://localhost/MySite/MyControlDir/MyControl.dll#MyControlNamespace.MyControl
Microsoft.IE.SecureFactory: System.Reflection.TargetInvocationException:
Exception has been thrown by the target of an invocation. --->
System.Security.SecurityException: Request for the permission of type
System.Security.Permissions.SecurityPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.CheckSecurity(ParseRecord
pr)
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObject(ParseRecord
pr)
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Parse(ParseRecord
pr)
at
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped
record)
at
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum
binaryHeaderEnum)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler
handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage
methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream
serializationStream, HeaderHandler handler, Boolean fCheck,
IMethodCallMessage methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream
serializationStream)
at System.Resources.ResourceReader.LoadObject(Int32 pos)
at System.Resources.RuntimeResourceSet.GetObject(String key, Boolean
ignoreCase)
at System.Resources.ResourceManager.GetObject(String name, CultureInfo
culture)
at System.Resources.ResourceManager.GetObject(String name)
at MyControl.InitializeComponent()
at MyControl..ctor()
--- End of inner exception stack trace ---
I can't make much sense of the exception but I have searched to no avail.
Am I missing a small but important step? Please let me know!
Thank you in advance,
Marco
loading the control in a Local Intranet Zone, meaning that
http://localhost/MyWebPage.htm has the embedded control. I have:
1) Strong Named my control
2) added [assembly: System.Security.AllowPartiallyTrustedCallers]
attribute to my AssemblyInfo.cs file
3) created a custom Code Group under "All_Code" in Machine Runtime
Security Policy
4) set the "Membership Condition" of my code group to be "Strong Name" and
imported the file (with and without the Name and Version)
5) set the "Permission Set" to be "FullTrust"
All to not have my control load up correctly. This is the IEDebug output:
Microsoft.IE.SecureFactory: Trying to create instance of type
http://localhost/MySite/MyControlDir/MyControl.dll#MyControlNamespace.MyControl
Microsoft.IE.SecureFactory: System.Reflection.TargetInvocationException:
Exception has been thrown by the target of an invocation. --->
System.Security.SecurityException: Request for the permission of type
System.Security.Permissions.SecurityPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.CheckSecurity(ParseRecord
pr)
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObject(ParseRecord
pr)
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Parse(ParseRecord
pr)
at
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped
record)
at
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum
binaryHeaderEnum)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler
handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage
methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream
serializationStream, HeaderHandler handler, Boolean fCheck,
IMethodCallMessage methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream
serializationStream)
at System.Resources.ResourceReader.LoadObject(Int32 pos)
at System.Resources.RuntimeResourceSet.GetObject(String key, Boolean
ignoreCase)
at System.Resources.ResourceManager.GetObject(String name, CultureInfo
culture)
at System.Resources.ResourceManager.GetObject(String name)
at MyControl.InitializeComponent()
at MyControl..ctor()
--- End of inner exception stack trace ---
I can't make much sense of the exception but I have searched to no avail.
Am I missing a small but important step? Please let me know!
Thank you in advance,
Marco