Le réseau pour les développeurs > Forums - Accueil > Visual C# General > "That assembly does not allow partially trusted callers."
Poser une questionPoser une question
 

Traitée"That assembly does not allow partially trusted callers."

  • mercredi 22 février 2006 07:21James_Steven Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     

    I don't understand this...

    Whenever i click my button i get the following error: "That assembly does not allow partially trusted callers."

    What can be wrong? I'm reading the source code of an example application using the MySQL connector, and i'm trying to create a similar application. It's pretty embaracing :(

    [STAThread]
    static void Main()
    {
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    Application.Run(new Form1()); <--- "That assembly does not allow partially trusted callers."

    FORM1.CS:
    using System;
    ...

    using
    MySql.Data.MySqlClient;

    namespace MysqlConnectionTest
    {
    public partial class Form1 : Form

     
    public Form1()
    {
    InitializeComponent();
    }
    private void button1_Click(object sender, EventArgs e)
    {

    string connStr = String.Format("server={0};user id={1}; password={2}; database={3}; pooling=false", "bla", "bla", "bla", "bla");

    MySqlConnection conn = new MySqlConnection(connStr);

    }
    }
    }

Réponses

Toutes les réponses