Strange Problem with Interface

G

Guest

Ok, I have a strange problem. I have a DLL that defines a couple of
interfaces. They just have a few properties and a couple of functions in
them. Now, I create a new Windows Forms project and add a reference to that
DLL. Now, before I do anything, I run the project. A blank form pops up.
That's good. Now, I add the Implements line for one of the interfaces, which
automatically creates the property and function shells for me. But when I
try to run it again, I get the following error :

--------------
An unhandled exception of type 'System.TypeLoadException' occurred in
Unknown Module.

Additional information: Could not load type WindowsApplication3.Form1 from
assembly WindowsApplication3, Version=1.0.1994.17092, Culture=neutral,
PublicKeyToken=null.
 
C

CodeMeister

Have you renamed the class Form1? If you have, you need to change your
startup object to use the correct form name. In C#, find your Main method
and edit the name of the class in the Applicatn.Run call. In VB.Net right
click on your project name and select properties. Change the name of the
startup object.

IHTH

Jon
 
G

Guest

No, I didn't rename the class. That's the default name that VB.Net gives it.
The project is set to use Form1 as the startup object.


CodeMeister said:
Have you renamed the class Form1? If you have, you need to change your
startup object to use the correct form name. In C#, find your Main method
and edit the name of the class in the Applicatn.Run call. In VB.Net right
click on your project name and select properties. Change the name of the
startup object.

IHTH

Jon
 
G

Guest

I'm still hitting this problem. Does anyone have any idea what could be
causing this? Thanks!

Bagger said:
No, I didn't rename the class. That's the default name that VB.Net gives it.
The project is set to use Form1 as the startup object.
 
G

Guest

Bagger, I ran into the same exception today. As it turns out, it was a faux
pas on my part, and the environment can't detect it...
The executable had the same name as the referenced DLL, IE Data.exe trying
to load Data.dll... builds fine, just can't run it...

Hope this helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top