Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic I get Security Permission error with SaveToString (Read 3358 times)
Eliseo
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Location: Mexico
Joined: Nov 7th, 2005
I get Security Permission error with SaveToString
Nov 9th, 2005 at 10:16pm
Print Post  
I'm using FlowChart as an embedded .Net object and I need to save the layout modifications I made to a flowchart to a hidden field in order to preserve the changes when I execute server side code.

I tried using the following VB script code snippet when clicking a button:

Code
Select All
sub saveFlowChart()
    MsgBox Form.fc.SaveToString
    Form.Diagram.value = Form.fc.SaveToString()
end sub
 



And all I get is a nasty VB Script error:


Security Exception Error Message:
An unhandled exception of type 'System.Security.SecurityException' occurred in mscorlib.dll.

Additional information: Request for the permission of type System.Security.Permissions.SecurityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed."


I found a MS Knowledge Base article and I downloaded and installed the patch but it still won't work.

http://support.microsoft.com/kb/836989
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: I get Security Permission error with SaveToStr
Reply #1 - Nov 10th, 2005 at 5:22am
Print Post  
Another developer reported the same problem a couple of weeks ago. He found in the Internet that the Indexing service might cause security exceptions with .NET memory streams (used in SavetoString), so he disabled it on the client side and now SaveToString works for him.

A situation where Flowchart.NET could need permission higher than the default security permissions is when you have controls hosted in ControlHost nodes. While saving them, FC.NET tries to access the control assemblies to get their version information, and that needs Reflection and disk I/O permissions assigned to it.

You can assign more permissions to Flowchart.NET like this:

Open Control panel
Open Administrative tools
Open Microsoft .NET Framework 1.1 Configuration
In the tree on the left expand Runtime Security Policy
Choose Machine
Choose Code Groups\All Code\
Select the zone from which you are running your application, e.g. Intranet
or Internet (look the IE status bar icons to know which zone to choose)
you can either change the settings for the zone (all .NET components
running in it) or ...
Right click the zone and choose duplicate
Rename the copy to fc.net or something similar
Open the copy properties dialog, go to the Membership conditions tab
For condition choose 'strong name' and import the flowchart.net.dll
assembly
Go to the Permission Set tab and choose 'Everything'
choose ok etc. until the settings are applied
restart all IE instances and reload the application.

But that must be done on each client PC.

Stoyan
  
Back to top
 
IP Logged
 
Eliseo
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Location: Mexico
Joined: Nov 7th, 2005
Re: I get Security Permission error with SaveToStr
Reply #2 - Nov 10th, 2005 at 1:41pm
Print Post  
Thanks! That worked! But at first I found it a little confusing to tell which ones were the optional steps .

Stoyo wrote on Nov 10th, 2005 at 5:22am:
Open Control panel
Open Administrative tools
Open Microsoft .NET Framework 1.1 Configuration
In the tree on the left expand Runtime Security Policy
Choose Machine
Choose Code Groups\All Code\
Select the zone from which you are running your application, e.g. Intranet
or Internet (look the IE status bar icons to know which zone to choose)
you can either change the settings for the zone (all .NET components
running in it) or ...

Right click the zone and choose duplicate
Rename the copy to fc.net or something similar
Open the copy properties dialog, go to the Membership conditions tab
For condition choose 'strong name' and import the flowchart.net.dll
assembly

Go to the Permission Set tab and choose 'Everything'
choose ok etc. until the settings are applied
restart all IE instances and reload the application.

But that must be done on each client PC.

Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: I get Security Permission error with SaveToStr
Reply #3 - Nov 10th, 2005 at 4:23pm
Print Post  
Ok sorry, indeed I could make the list more legible...
  
Back to top
 
IP Logged
 
mattcole
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: Jan 7th, 2006
Re: I get Security Permission error with SaveToStr
Reply #4 - Oct 2nd, 2006 at 8:39am
Print Post  
Hi,

I know this thread is very old now, but I'm having the same problem.  I've had the problem in the past, but resolved it via the steps listed below.  However, the problem now is that the application is actually being hosted and remote users will need to use the page with the flowchart in it, and it's obviously impractical for them to go through these permission steps. 

So what I was wondering is if you could elaborate on why the control needs more permission than it has, I haven't heard of ControlHost nodes so don't believe that I am using them, are there any other circumstances that you believe may cause this issue?

Thanks,
Matt
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: I get Security Permission error with SaveToStr
Reply #5 - Oct 2nd, 2006 at 10:13am
Print Post  
Hi,

Please use SaveToFile to save the diagram on the server and email it to me. Our developer will trace through the flowchart's code to see what exactly requires more permissions.

Thanks,
Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: I get Security Permission error with SaveToStr
Reply #6 - Oct 3rd, 2006 at 5:03pm
Print Post  
Ok, that happens with FlowChart.NET versions older than 4.0.2. Since version 4.0.2 SaveToString works fine with the default CAS settings for the Internet zone .

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint