473,503 Members | 10,245 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 3924
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 (dependentAssembly 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.ja.net...
Alternatively, you can use (dependentAssembly 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.Invalid pointer.
What is this guys ! It kills me all this error messages.

Thank you,
Mihai
"Mythran" <ki********@hotmail.comwrote in message
news:uv****************@TK2MSFTNGP03.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 (dependentAssembly 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.15753$kY6.1508@edtnps82...
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.Invalid pointer.
What is this guys ! It kills me all this error messages.

Thank you,
Mihai
"Mythran" <ki********@hotmail.comwrote in message
news:uv****************@TK2MSFTNGP03.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 (dependentAssembly 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 (dependentAssembly 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.ja.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 (dependentAssembly 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********@hotmail.comwrote in message
news:OG**************@TK2MSFTNGP04.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...
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 (dependentAssembly 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
3869
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...
9
3584
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
4014
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...
34
3222
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:...
2
23361
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...
1
5830
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...
4
3234
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...
34
5297
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...
8
11459
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...
6
4037
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,...
0
7193
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,...
0
7264
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,...
0
5562
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,...
1
4992
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3160
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...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
371
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...

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.