1

I am rebuilding a project that I originally coded in SharpDevelop in Visual Studio. The relevant code worked in SharpDevelop.

The following steps should illustrate the problem:

  1. Create a new project
  2. Add a reference to System.Data.SQLLite (I am using the DLL for .NET 4.5)
  3. In the main form, add the using statement:

    using System.Data.SQLite;

  4. In the form's Load event, attach the event handler

        private void PriceType2_Load(object sender, EventArgs e)
    {
    
        MessageBox.Show("Load event hNDLER");
        SQLiteConnection con;
        //con = new SQLiteConnection();
    
    }
    

That works, but if you uncomment the next line, it doesn't.

        private void PriceType2_Load(object sender, EventArgs e)
    {
        //SetDisableColors();
        //ToggleEnableOff();
        MessageBox.Show("Load event");
        SQLiteConnection con;
        con = new SQLiteConnection();

    }

The form opens, but the message box is not displayed. As I said, it works fine in SharpDevelop. And in case you're wondering, I am migrating the project because I need a grown up Report Viewer.

Any ideas?

4

1 に答える 1

0

.NET 4.0 のアセンブリへの参照を変更したところ (私の開発マシンと他のすべてのマシンは 4.5 ですが)、動作します。4.5 DLL に問題があるとどこかで読んだ記憶がありますが、それが何であるかはわかりません。

すべてのポインタをありがとう。

于 2013-11-11T22:52:04.577 に答える