IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Windows Forms Discussion :

[VBNET] System.Security.SecurityException


Sujet :

Windows Forms

  1. #1
    Membre éclairé Avatar de PoZZyX
    Inscrit en
    Août 2005
    Messages
    426
    Détails du profil
    Informations forums :
    Inscription : Août 2005
    Messages : 426
    Par défaut [VBNET] System.Security.SecurityException
    Bonjour,

    j'essaie de débuter en VB.net et dès le début j'ai un problème :S
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    PublicClass frm_identification
    PrivateSub cmd_quitter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmd_quitter.Click
    Application.Exit()
    EndSub
    EndClass
    
    J'essaie simplement de quitter l'application quand je clique sur un bouton et j'obtiens une fenetre sous visual studio :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
     
    System.Security.SecurityException was unhandled
      Message="Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."
      Source="mscorlib"
      StackTrace:
           at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
           at System.Security.CodeAccessPermission.Demand()
           at System.Windows.Forms.Application.Exit(CancelEventArgs e)
           at System.Windows.Forms.Application.Exit()
           at GEPL.frm_identification.cmd_quitter_Click(Object sender, EventArgs e)
           at System.Windows.Forms.Control.OnClick(EventArgs e)
           at System.Windows.Forms.Button.OnClick(EventArgs e)
           at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
           at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
           at System.Windows.Forms.Control.WndProc(Message& m)
           at System.Windows.Forms.ButtonBase.WndProc(Message& m)
           at System.Windows.Forms.Button.WndProc(Message& m)
           at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
           at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
           at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
           at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
           at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.Run(ApplicationContext context)
           at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
           at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
           at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
           at GEPL.My.MyApplication.Main(String[] Args)
           at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
           at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
           at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
           at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           at System.Threading.ExecutionContext.runTryCode(Object userData)
           at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
           at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ThreadHelper.ThreadStart()
    Je ne comprend pas ce que j'ai fait de mal

    Merci d'avance pour votre aide

  2. #2
    Membre éclairé Avatar de PoZZyX
    Inscrit en
    Août 2005
    Messages
    426
    Détails du profil
    Informations forums :
    Inscription : Août 2005
    Messages : 426
    Par défaut
    J'ai résolu le problème en modifiant les paramètres du .net Framework pour l'autoriser à exécuter des applications sur le réseau.

    Mais comment est-ce que je fais pour éviter ça chez toutes les personnes à qui j'enverrais cette application ?

  3. #3
    Rédacteur
    Avatar de JauB
    Homme Profil pro
    Freelancer
    Inscrit en
    Octobre 2005
    Messages
    1 792
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Maroc

    Informations professionnelles :
    Activité : Freelancer
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Octobre 2005
    Messages : 1 792
    Par défaut
    tu execute ton exe à partir d'un serveur web ou quoi?
    Mes articles, Mon Blog

    Rubrique Jasper/iReport :
    ------- Forum Jasper --------
    ----- FAQ Jasper/iReport -----


  4. #4
    Membre éclairé Avatar de PoZZyX
    Inscrit en
    Août 2005
    Messages
    426
    Détails du profil
    Informations forums :
    Inscription : Août 2005
    Messages : 426
    Par défaut
    à partir d'un lecteur réseau

  5. #5
    Rédacteur
    Avatar de JauB
    Homme Profil pro
    Freelancer
    Inscrit en
    Octobre 2005
    Messages
    1 792
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Maroc

    Informations professionnelles :
    Activité : Freelancer
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Octobre 2005
    Messages : 1 792
    Par défaut
    ce problème est deja posté sur ce forumet a été résolu!mais je me rappelle plus de la solution!!en tout cas tu dois faire certaines autorisations de ton exe pour qu'il puise s'executer!
    Cherche bien dans le forum
    Mes articles, Mon Blog

    Rubrique Jasper/iReport :
    ------- Forum Jasper --------
    ----- FAQ Jasper/iReport -----


  6. #6
    Membre éclairé Avatar de PoZZyX
    Inscrit en
    Août 2005
    Messages
    426
    Détails du profil
    Informations forums :
    Inscription : Août 2005
    Messages : 426
    Par défaut
    lol après avoir parcouru tout les résultat d'une rechercher du mot clé réseau dans les forums dotnet, j'ai envie de me suicider, j'ai rien trouvé, enfin si des gens qui avait le meme problème non résolu.

    Un trux pareil ça devrait se trouver dans la FAQ au moins (enfin me semble pas que c'est le cas)

    Merci pour ton aide en tout cas

Discussions similaires

  1. Debug - 'System.Security.SecurityException'
    Par REMACC1 dans le forum Windows Forms
    Réponses: 2
    Dernier message: 06/11/2008, 11h24
  2. Réponses: 3
    Dernier message: 19/08/2008, 20h07
  3. Réponses: 1
    Dernier message: 04/04/2008, 13h50
  4. Réponses: 0
    Dernier message: 21/08/2007, 21h08
  5. [Delphi.NET][SDK] Comment interpréter System.Security.SecurityException?
    Par Laurent Dardenne dans le forum Delphi .NET
    Réponses: 4
    Dernier message: 07/04/2005, 12h43

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo