I think you're looking for, though this may not work at all. You may have to move the code to a class separate from Program: (I don't have time to test this)
namespace TestApp
{
static class Program
{
... Your DllImport line(s) for the test
... function you want to call goes here
static Program()
{
... Your architecture determination
... and dll loading code goes here
}
[STAThread]
static void Main()
{
... Your "test" call to the functions in the DLL goes here
Debug.WriteLine("Wanted to make sure if the DLL Loaded");
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}