473,568 Members | 2,986 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dll path

For example:
I have 2 projects (VB.NET) : A class library - Proj1
A windows control library - Proj2
I have a reference in proj2 for proj1
In the Build output path of project 1 I put the folder c:\t1
In the Build output path of project 2 I put the folder c:\t2

The startup project is Proj2
When I build the proj2 it copies in the c:\t2 the dll for project 1. Why is
happening this ? How can I modified this?Because I put the reference in
proj2 the dll from the folder c:\t1 .I want allways to take from c:\t1 , not
to copy the dll for proj1 in c:\t2.

Thank,
Mihai

Jun 7 '07 #1
7 3929
Mihai wrote:
I have 2 projects (VB.NET) : A class library - Proj1
A windows control library - Proj2
I have a reference in proj2 for proj1
In the Build output path of project 1 I put the folder c:\t1
In the Build output path of project 2 I put the folder c:\t2
When I build the proj2 it copies in the c:\t2 the dll for project 1.
Why is this happening ?
Because you added a reference to a Dll that's /not/ in the Global
Assembly Cache, so VB assumed you wanted your own copy of it.

The thinking behind this is that if you [x]copied the whole directory
(including the copied Dll) onto a new machine, it would [probably] run,
because everything the application needs is there.

This /isn't/ as much of a problem as you might think and many people
work this way, with lots (and lots) of physical copies of the same Dll,
running within /different/ applications. It makes each application
resilient, because it has everything it needs and, if you ship an
application with a newer version of the dll, none of the other
applications care; they carry on using their own copy.

It you want to reuse the /same/ Dll in multiple applications, though,
you have to do things differently.

Personally, I put shared assemblies into the Global Assembly Cache (they
have to be Strongly Named, first). Doing this also prevents VB from
taking those [annoying] local copies of Dll's (actually, it's the /only/
way I've found to prevent it!).

Alternatively, you can use (dependentAssem bly and codeBase) entries in
App.Config to tell the application where to look for its Dll's. This
solves the problem at Run-time, but VB will still do its local-copy
thing when you rebuild the project.

HTH,
Phill W.
Jun 8 '07 #2


"Phill W." <p-.-a-.-w-a-r-d-@-o-p-e-n-.-a-c-.-u-kwrote in message
news:f4******** **@south.jnrs.j a.net...
Alternatively, you can use (dependentAssem bly and codeBase) entries in
App.Config to tell the application where to look for its Dll's. This
solves the problem at Run-time, but VB will still do its local-copy thing
when you rebuild the project.
Phil,

You can also go to the properties for the reference and change the "Copy
Local" property to False. This prevents the copy.

HTH,
Mythran
Jun 8 '07 #3
After I changed the reference property Copy local = False it gives me an
error : Could not load file or assembly Proj1.dll or one of its
dependencies.In valid pointer.
What is this guys ! It kills me all this error messages.

Thank you,
Mihai
"Mythran" <ki********@hot mail.comwrote in message
news:uv******** ********@TK2MSF TNGP03.phx.gbl. ..
>

"Phill W." <p-.-a-.-w-a-r-d-@-o-p-e-n-.-a-c-.-u-kwrote in message
news:f4******** **@south.jnrs.j a.net...
Alternatively, you can use (dependentAssem bly and codeBase) entries in
App.Config to tell the application where to look for its Dll's. This
solves the problem at Run-time, but VB will still do its local-copy
thing
when you rebuild the project.

Phil,

You can also go to the properties for the reference and change the "Copy
Local" property to False. This prevents the copy.

HTH,
Mythran


Jun 10 '07 #4


"Mihai" <bv*****@telus. netwrote in message
news:tW%ai.1575 3$kY6.1508@edtn ps82...
After I changed the reference property Copy local = False it gives me an
error : Could not load file or assembly Proj1.dll or one of its
dependencies.In valid pointer.
What is this guys ! It kills me all this error messages.

Thank you,
Mihai
"Mythran" <ki********@hot mail.comwrote in message
news:uv******** ********@TK2MSF TNGP03.phx.gbl. ..
>>

"Phill W." <p-.-a-.-w-a-r-d-@-o-p-e-n-.-a-c-.-u-kwrote in message
news:f4******* ***@south.jnrs. ja.net...
Alternatively, you can use (dependentAssem bly and codeBase) entries in
App.Config to tell the application where to look for its Dll's. This
solves the problem at Run-time, but VB will still do its local-copy
thing
when you rebuild the project.

Phil,

You can also go to the properties for the reference and change the "Copy
Local" property to False. This prevents the copy.

HTH,
Mythran


Once copy-local is set to False, you have to install the assembly into the
GAC so the application can load it, as Phill stated in his previous reply.

HTH,
Mythran
Jun 11 '07 #5
Mythran wrote:
>
Once copy-local is set to False, you have to install the assembly into
the GAC so the application can load it, as Phill stated in his previous
reply.
Not necessarily. As I also said:
Alternatively, you can use (dependentAssem bly and codeBase) entries in
App.Config to tell the application where to look for its Dll's.
And /relative/ paths do work (at least in VB'2003)!

HTH,
Phill W.
Jun 12 '07 #6


"Phill W." <p-.-a-.-w-a-r-d-@-o-p-e-n-.-a-c-.-u-kwrote in message
news:f4******** **@south.jnrs.j a.net...
Mythran wrote:
>>
Once copy-local is set to False, you have to install the assembly into
the GAC so the application can load it, as Phill stated in his previous
reply.

Not necessarily. As I also said:
Alternatively, you can use (dependentAssem bly and codeBase) entries in
App.Config to tell the application where to look for its Dll's.

And /relative/ paths do work (at least in VB'2003)!

HTH,
Phill W.
Yes, I know this but didn't mention it in my previous reply. Thanks for
correcting it.

Mythran
Jun 12 '07 #7
Thanks to both of you, now is clear for me !

Regards,
Mihai

"Mythran" <ki********@hot mail.comwrote in message
news:OG******** ******@TK2MSFTN GP04.phx.gbl...
>

"Phill W." <p-.-a-.-w-a-r-d-@-o-p-e-n-.-a-c-.-u-kwrote in message
news:f4******** **@south.jnrs.j a.net...
Mythran wrote:
>
Once copy-local is set to False, you have to install the assembly into
the GAC so the application can load it, as Phill stated in his previous
reply.
Not necessarily. As I also said:
Alternatively, you can use (dependentAssem bly and codeBase) entries in
App.Config to tell the application where to look for its Dll's.
And /relative/ paths do work (at least in VB'2003)!

HTH,
Phill W.

Yes, I know this but didn't mention it in my previous reply. Thanks for
correcting it.

Mythran


Jun 13 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

31
3880
by: John Roth | last post by:
I'm adding a thread for comments on Gerrit Holl's pre-pep, which can be found here: http://tinyurl.com/2578q Frankly, I like the idea. It's about time that all of the file and directory stuff in the os module got objectified properly (or at least with some semblance of OO propriety!) In the issues section:
9
3592
by: Bengt dePaulis | last post by:
I have a local directory that I want to include in my sys.path How to save it permanently? Regards /Bengt
70
4041
by: Michael Hoffman | last post by:
Many of you are familiar with Jason Orendorff's path module <http://www.jorendorff.com/articles/python/path/>, which is frequently recommended here on c.l.p. I submitted an RFE to add it to the Python standard library, and Reinhold Birkenfeld started a discussion on it in python-dev...
34
3234
by: Reinhold Birkenfeld | last post by:
Hi, the arguments in the previous thread were convincing enough, so I made the Path class inherit from str/unicode again. It still can be found in CVS: /python/nondist/sandbox/path/{path.py,test_path.py} One thing is still different, though: a Path instance won't compare to a regular string.
2
23368
by: Rob Cowie | last post by:
Hi, Given a string representing the path to a file, what is the best way to get at the filename? Does the OS module provide a function to parse the path? or is it acceptable to split the string using '/' as delimiters and get the last 'word'. The reason I'm not entirely happy with that method is that it is platform specific. I would prefer...
1
5842
by: William Stacey [MVP] | last post by:
I need a bullet proof way to combine a root and a relative path to form a FQ rooted path (similar to a VDir in IIS). Path.Combine alone will not do the job in all cases. I also need to be sure the no funny business can go on in the passed "path" that would produce a path not in the root (i.e. "..\..\dir1"). Here is my first stab at it, but...
4
3244
by: python | last post by:
Bad file names, i.e. filenames the OS considers illegal, will cause functions in the os.path module to raise an error. Example: import os.path print os.path.getsize( 'c:/pytest/*.py' ) On Windows XP using Python 2.5.2 I get the following traceback:
34
5310
by: Alexnb | last post by:
Gerhard Häring wrote: No, it didn't work, but it gave me some interesting feedback when I ran it in the shell. Heres what it told me: Traceback (most recent call last): File "<pyshell#10>", line 1, in <module> os.startfile("C:\Documents and Settings\Alex\My Documents\My
8
11471
by: moondaddy | last post by:
I'm posting code for a user control ( FunctionConnectorSelector) below which has 3 content controls in it. each content control uses a style from a resource dictionary merged into the app.xaml file. each control has a border with another style, and each border has a unique path inside of it. I need to dynamically add these content controls...
6
4042
by: bukzor | last post by:
I have to go into these convulsions to get the directory that the script is in whenever I need to use relative paths. I was wondering if you guys have a better way: from os.path import dirname, realpath, abspath here = dirname(realpath(abspath(__file__.rstrip("c")))) In particular, this takes care of the case of symlinked, compiled...
0
7693
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7917
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7665
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6277
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.