dll not found

  • Thread starter Thread starter Frank
  • Start date Start date
F

Frank

Hello,
I have usercontrol dll. If I reference it in the calling application with
local copy=true it works fine. If I set local copy to false. I get an error
saying the dll cannot be found. What do I have to set to ensure the dll in
the bin of the usercontrol is used?
The reference path in the projectproperties refers to that bin. Someplace
else I have to set something?
Thanks
Frank
 
Hi, may I ask why you need to set local copy to false? If the usercontrol
DLL is recompiled, then the new version of the DLL is copied to your
application directory... if that's what you're worrying about.

--
HTH,
-- Tom Spink, Über Geek

Woe be the day VBC.EXE says, "OrElse what?"

Please respond to the newsgroup,
so all can benefit
 
Thanks, I didn't know/noticed and it solves my problem. But....it doesn't
answer the question, why is the dll not found?
Frank
 
Any supporting DLL that is not in your path, your current directory, or the
application directory will not be found (Since it doesn't know where to look
when it goes to do the runtime bind.) Local Copy copies the file into your
program's application directory. Since your DLL isn't in any of the folders
listed otherwise, the usercontrol file can't be found. Remember, there's no
class registry like there was in ActiveX to look it up in, (Which most
consider a good thing as it solves the DLL hell problem and allows for
side-by-side multiple version support.)

If you where to move your user control to, say, your system32 (on NT
systems) folder, you would no longer receive the error, but would have to
move it there every time you recompiled the user control, and would loose
side-by-side multi-versioning, so usually Local Copy is the method of
choice.

Hope that answers your question. ^.^
 
Yes, thanks JM,
but is there is way to change the path inside/during my VB session. So while
developing Appl A have the active path for ApplA also point to the bin of
appl B. Where/how is that path created?
Thanks
Frank
 
Well, the search path is derived from your PATH environment variable. In
Windows XP you can find where this variable is set (Well, where you can
change it anyway) by bringing up the system properties and then selecting
the advanced tab, clicking the environment variables button on the bottom,
and finding Path in the system variables list. However, this change applies
globally to your system. To make a change that only applies to your project,
(but may lead to unexpected results) you can change the working path for
your project under the project properties/configuration properties/working
directory. However, this only applies while working in the IDE and does not
affect the program anywhere else (I.E. will not fix it for release.)

You could also change the folder that Project B compiles to (in your
example), but that means that it will no longer compile to the bin folder in
its own directory and would only place the code in project A's folder, but
Local Copy has roughly the same effect while leaving the original binary
where it belongs.
 
I'm new to VB.Net and look thru the newsgroups to learn new things. I haven't seen local copy used. Could you explain where you can set it to true/false, i.e., in the dll declaration, etc. Thanks.
 
Dennis said:
I'm new to VB.Net and look thru the newsgroups to learn new things. I haven't seen local copy used.
Could you explain where you can set it to true/false, i.e., in the dll declaration, etc. Thanks.

Dennis,

Copy Local isn't part of the VB.NET language, it's a project management feature of Visual Studio .NET.

If you're running Visual Studio .NET and you view the Solutions Explorer, there will be a node under
every .NET Project named "References." Expanding that node lists the assemblies referenced by that
particular project (when Importing a namespace, you must specify it both in a .vb source file "Imports
Such.And.Such.Namespace" and ensure that the assembly defining that namespace has been added
to the References: in Visual Studio .NET by right-clicking and selecting Add Reference.., or from the
command-line vbc compiler through /R:assembly.name.dll).

The properties for each of these assembly references contain the Copy Local option. Setting this option
to True copies the assembly from it's referenced location to the application's /bin folder, that's all. In some
cases, like web applications, you want all assemblies the web application depends upon to be copied to
that folder to make them easy for ASP.NET to find.


Derek Harmon
 
Back
Top