Assembly.LoadFrom

D

dbhurt15

Let me say first that I'm brand new to .NET

I'm having a small issue. I'm working on a large project. My part is
using a .dll located in another directory. I'm having problems
referencing to that external dll

What I'm doing right now is using this on form load:
Dim Asmpath As String = ("C:\Common\newLib.dll")
Dim Asm As System.Reflection.Assembly =
System.Reflection.Assembly.LoadFrom(Asmpath)

but when I debug i get this exception:

Could not load file or assembly 'newLib, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=ae2fc87ca760880d' or one of its
dependencies. The system cannot find the file specified.

I know I must be using Assembly.LoadFrom wrong or am leaving something
else out. Any ideas to help along?
 
L

Lloyd Sheen

Let me say first that I'm brand new to .NET

I'm having a small issue. I'm working on a large project. My part is
using a .dll located in another directory. I'm having problems
referencing to that external dll

What I'm doing right now is using this on form load:
Dim Asmpath As String = ("C:\Common\newLib.dll")
Dim Asm As System.Reflection.Assembly =
System.Reflection.Assembly.LoadFrom(Asmpath)

but when I debug i get this exception:

Could not load file or assembly 'newLib, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=ae2fc87ca760880d' or one of its
dependencies. The system cannot find the file specified.

I know I must be using Assembly.LoadFrom wrong or am leaving something
else out. Any ideas to help along?

Why not just add a reference to the dll. It will load a copy any time you
execute and the dll has changed from your last execution.

LS
 
F

Family Tree Mike

It sounds to me like that dll depends on another dll which you don't have in
your working directory, nor in the common directory.
 
M

Mike Williams

I don't know whether anyone from Microsoft regularly reads the Visual Basic
groups but if they do then I am very surprised that they permit one of their
own MVPs to engage in such outrageous long term trolling activities in one
of their own public newsgroups, such as the activity that the person who
purports to be Bill McCarthy has engaged in on the
microsoft.public.vb.general.discussion group for many months. If this man
belongs to you:

https://mvp.support.microsoft.com/profile=B2D0BB02-3E35-4293-B4B9-25680609CCB8

.. . . then perhaps you might like to look at his activity in that group.
Here for example is one of his very latest offerings:
 

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