Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Security Exception when Importing Visio (Read 2926 times)
jgreen
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 27
Joined: Aug 12th, 2010
Security Exception when Importing Visio
Aug 19th, 2010 at 9:28pm
Print Post  
I'm getting a "System.Security.SecurityException: System.Security.Permissions.SecurityPermission" error when trying to import a Visio VDX file from my website (works great locally).

I'm using a fileUpload control to save the file to a folder (with read/write) and then trying to import it. File saves ok but as soon as it tries to import, I get the error.

Code
Select All
Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
        Dim sFName As String = Server.MapPath("~\") & "VisioVDX\" & uplFileName.FileName
        lblFName.Text = sFName
        uplFileName.SaveAs(sFName)
    End Sub


Protected Sub btnImportVisio_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnImportVisio.Click
        Dim v As New VisioImporter
        If lblFName.Text.Trim <> "" Then
            v.ImportAllPages(lblFName.Text, dgvMain.Diagram)
        End If
    End Sub
 



Site is hosted at GoDaddy which has Med. Trust Level set. No idea how to change it.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Security Exception when Importing Visio
Reply #1 - Aug 23rd, 2010 at 6:03am
Print Post  
This version should avoid the security exception:
https://mindfusion.eu/_beta/netdiag_visio.zip

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
jgreen
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 27
Joined: Aug 12th, 2010
Re: Security Exception when Importing Visio
Reply #2 - Aug 23rd, 2010 at 7:34pm
Print Post  
I copied the files to the bin folder on the server and still get the same error.
  
Back to top
 
IP Logged
 
jgreen
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 27
Joined: Aug 12th, 2010
Re: Security Exception when Importing Visio
Reply #3 - Aug 24th, 2010 at 1:49pm
Print Post  
Anything else I can try?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Security Exception when Importing Visio
Reply #4 - Aug 24th, 2010 at 3:29pm
Print Post  
Try setting importer.SuppressUnmanagedCode before calling Import() with this version:
https://mindfusion.eu/_beta/netdiag_unmg.zip
  
Back to top
 
IP Logged
 
jgreen
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 27
Joined: Aug 12th, 2010
Re: Security Exception when Importing Visio
Reply #5 - Aug 24th, 2010 at 9:29pm
Print Post  
That did it!   thanks!!!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint