Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    Errore: System.Security.SecurityException

    Ciao a tutti,

    Oggi ha smesso di funzionarmi uno script fino ad ora funzionato correttamente.
    Di asp.net capisco poco, a me sembra tutto corretto, non a caso fino ad ora aveva sempre funzionato. Qualcuno saprebbe aiutarmi cortesemente ?

    Il messaggio d'errore è il seguente:

    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: That assembly does not allow partially trusted callers.



    Mentre il codice è questo, con in rosso la riga che creerebbe il problema:

    codice:
    Sub Page_Load()
    
      Dim myConnection As New MySqlConnection("****")
    
      myConnection.Open()
    
    	Dim myCommand As New MySqlCommand("SELECT * FROM fotografie WHERE fotoid = " & Request("img"), myConnection) 
    	Dim myReader As MySqlDataReader 
    	myReader = myCommand.ExecuteReader()
    
    	Dim strPercorso As String
    
    	While myReader.Read()
            strPercorso = myReader("percorso")
        End While 
        myReader.Close()
    
      myConnection.Close()
    
    
      Dim width as Integer = 0
      Dim height as Integer = 0
    
      try
        ' ricava dimensioni dalla richiesta
        if not Request.QueryString("w") is Nothing Then
        width = Int32.Parse(Request.QueryString("w"))
        End if
        if not Request.QueryString("h") is Nothing Then
        height = Int32.Parse(Request.QueryString("h"))
        End if
    
      catch ex as Exception
      End Try
    
      ' ridimensiona l'immagine se specificato
      Dim immagine as String = Server.MapPath(strPercorso)
      if Not System.Io.File.Exists(immagine) then
        immagine = Server.MapPath("/images/nontrovata.gif")
      end if
      
      call ImgRedim(immagine, width, height)
    
      ' fermo il resto della risposta
      Response.End()
    End Sub

    Grazie 1000
    SGr33n

  2. #2
    Risolto aggiornando la libreria all'ultima versione
    SGr33n

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.