Project works on dev machine only

T

Tim Zych

Stumped here.

When I access a ComClass enabled library in Excel on the development
machine, it works fine. When I install the app on another machine, and try
to access it, I get an error:

"File or assembly name DotNetApp, or one of its dependencies, was not
found."

I have a Class Library vb.net solution. It uses ComClass method to make it
accessible from a COM application (Excel). The "register for COM interop" is
checked. It also uses a 3rd party control. After I install the app, I can
see the 3rd party DLLs as well as the DotNetApp.DLL and DotNetApp.TLB in the
destination directory.

An Excel macro instantiates the class and shows a form. When I run this from
the development machine, it works fine.

When I install it onto another machine and try to instantiate the class, it
errors.

Dim c As DotNetApp.ClassName
Set c= New DotNetApp.ClassName ' ERROR
The 2nd line produces an error:

"File or assembly name DotNetApp, or one of its dependencies, was not
found."

What am I not doing, or doing wrong?
 
R

rowe_newsgroups

Stumped here.

When I access a ComClass enabled library in Excel on the development
machine, it works fine. When I install the app on another machine, and try
to access it, I get an error:

"File or assembly name DotNetApp, or one of its dependencies, was not
found."

I have a Class Library vb.net solution. It uses ComClass method to make it
accessible from a COM application (Excel). The "register for COM interop" is
checked. It also uses a 3rd party control. After I install the app, I can
see the 3rd party DLLs as well as the DotNetApp.DLL and DotNetApp.TLB in the
destination directory.

An Excel macro instantiates the class and shows a form. When I run this from
the development machine, it works fine.

When I install it onto another machine and try to instantiate the class, it
errors.

Dim c As DotNetApp.ClassName
Set c= New DotNetApp.ClassName ' ERROR
The 2nd line produces an error:

"File or assembly name DotNetApp, or one of its dependencies, was not
found."

What am I not doing, or doing wrong?

You do have Excel on the other machine right?

Thanks,

Seth Rowe
 
T

Tim Zych

Yes, the other machines have Excel (I have tried this on 3 diff
machines..same problem) I can see the reference in Excel's VBE, and can Dim
a variable to the vb.net class. I just can proceed with the 2nd line.

As far as I can tell, the environments are similar. Same versions of Excel,
same versions of the Framework.
 
M

Michel Posseth [MCP]

Did you register your comclass with Regasm or did you used a installer
module with the com flag on to install your custom com class on the target
machine ?
cause the IDE will do this automaticly for you

HTH

Michel
 
T

Tim Zych

I checked "Register for COM Interop" in the project's Compile properties.


--
Tim Zych
SF, CA

Michel Posseth said:
Did you register your comclass with Regasm or did you used a installer
module with the com flag on to install your custom com class on the target
machine ?
cause the IDE will do this automaticly for you

HTH

Michel
 
G

Guest

That really doesn't answer the question. When you copy to the other machine,
you need to run a command in a dos window (regsvr32 mycode.dll) or use an
installer system which does this. Did you do either of these steps?

Tim Zych said:
I checked "Register for COM Interop" in the project's Compile properties.
 
M

Michel Posseth [MCP]

well it might be an idea to try it while manually registring the COM class
with Regasm.exe
http://msdn2.microsoft.com/en-us/library/tzat5yw6(VS.71).aspx

Maybe it shows an error that it can`t register on the target systems for
whatever reasson

also note the following :

A COM creatable class must have a public sub new with no parameters even if
you do not need initializers in that case provide an empty method

Public sub New()
'--- For COM
End sub

Michel
 

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