Hi, all
When I embeded GoDiagram Win 2.2 in my asp.net webform. I’ve got a SecurityException error.
Have you ever seen this exception in your web form?
- Source Code
// GoDiagram License
Northwoods.Go.GoView.VersionName = “#License value get from Licensemanager #”;
// create a Go view (a Control) and add to the form
GoView myView = new GoView();
myView.Dock = DockStyle.Fill;
this.Controls.Add(myView);
myView.Document.UndoManager = new GoUndoManager();
try
{
// create two nodes for fun…
GoBasicNode node1 = new GoBasicNode();
// specify position, label and color
node1.Location = new PointF(100, 100);
node1.Text = “first”;
node1.Editable = true; // first node is editable with F2 only
node1.Brush = Brushes.Blue;
// add to the document, not to the view
myView.Document.Add(node1);
}
catch (Exception ex)
{
this.textBox1.Text += ex.ToString();
}
- Exception Message
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.Security.CodeAccessSecurityEngine.ThrowSecurityExcept ion(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)
at System.Security.CodeAccessSecurityEngine.ThrowSecurityExcept ion(Object assemblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)
at System.Security.CodeAccessSecurityEngine.CheckSetHelper(Perm issionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandle rmh, Object assemblyOrString, SecurityAction action, Boolean throwException)
at System.Security.CodeAccessSecurityEngine.CheckSetHelper(Comp ressedStack cs, PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandle rmh, Assembly asm, SecurityAction action)
at Northwoods.Go.GoShape.GetPenInfo(Pen p)
at Northwoods.Go.GoShape…ctor()
at Northwoods.Go.GoPort…ctor()
at Northwoods.Go.GoBasicNode.CreatePort()
at Northwoods.Go.GoBasicNode…ctor()
at SC710.SC710040…ctor()
The action that failed was:
InheritanceDemand
The type of the first permission that failed was:
System.Security.Permissions.SecurityPermission
The Zone of the assembly that failed was:
Intranet