Instatiating A Class

G

Guest

I have a console application. The "main: driver instantiates a class which
does all of the work.

I decided that I wanted to create a Windows From which would call the class
which was created in the console application. It has been forever since I
worked with a Windows application, but there is absolutely nothing to this
Windows form. When I press the button on the form which will eventually
instantiate an instance of the class noted above, I get a "TypeLoadException"
with the message "Could not load GLBatch.Comboedits.ComboEditReport from
assembly ComboEdits. "GLBatch.Comboedits.ComboEditReport" is the class I am
trying to create an instance of.

If I am debugging, it never gets to the code which is attempting to
instantiate the class or any of the code associated with the button which is
pressed...

What am I missing? (I have a reference to the assembly)
 
G

Guest

Not exactly sure from reading your post what may be going on but I suspect
the key phrase is that the class was originally "in a console application".
Try this:

1) create a new class library project, put your class code in it, and make
sure it compiles. It should be a dll.
2) In your windows forms app, set a PROJECT reference to this class library
project.
3) see if you can get it to work. (A "using xzy.myclass" statement at the
top of your Form class will help.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder(BETA): http://www.blogmetafinder.com
 

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