Hi Everyone. I don't get this error locally so I'm assuming it has something to do with the trust level. Nothing I've tried seems to correct it though. I used the following in the system.web section of my web.config <securityPolicy> <trustLevel name="Full" policyFile="internal" /> </securityPolicy > The exception is: Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. The code running is: Dim sFilePath As String Dim buffer As Byte() Dim mydata As New DCHS_Data.DCHSCore_SQL_BaseData Using conn As SqlConnection = mydata.Return_New_Connection() 'conn.Open() Using cmd As New SqlCommand("Select Newsletter_File from DCHSCore_Newsletters where Newsletter_Current='True'", conn) buffer = cmd.ExecuteScalar() End Using conn.Close() End Using sFilePath = System.IO.Path.GetTempFileName() System.IO.File.Move(sFilePath, System.IO.Path.ChangeExtension(sFilePath, ".pdf")) sFilePath = System.IO.Path.ChangeExtension(sFilePath, ".pdf") System.IO.File.WriteAllBytes(sFilePath, buffer) Dim act As Action(Of String) = New Action(Of String)(AddressOf OpenPDFFile) act.BeginInvoke(sFilePath, Nothing, Nothing) Private Shared Sub OpenPDFFile(ByVal sFilePath As String) Using p As New System.Diagnostics.Process p.StartInfo = New System.Diagnostics.ProcessStartInfo(sFilePath) p.Start() p.WaitForExit() Try System.IO.File.Delete(sFilePath) Catch End Try End Using End Sub I'm in a bind and need a fix for this quickly. Anyone have any ideas?
Hi... changing the webconfig to ... <system.web> <trust level="Full" /> </system.web> Makes the error go away but now the file does not open...
I'm not seeing what you're seeing. I pulled up your page and everything looks like its working. Have you tried viewing your site on another browser?
Sorry Ray. http://deloneca.w02.Winhost.com/newsletters.aspx?MenuPageID=23&Title=Newsletters - Previous&Type=2 click on any of the linkbuttons
I'm running through your tests and this is what I am getting... Newsletters No past newsletters have been loaded yet. The current newsletter can be found in the navigation menu at the left under 'Current Newsletter'. I'm still not clear on what your application is suppose to do but the message indicates that you first need to upload a current newsletter. Sorry, you're not giving me enough information to really troubleshoot this.