473,799 Members | 3,106 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Private assembly reference path

Hi all,
I have a .net windows application xx.exe, which reference
a private assembly yy.dll, the property "local copy" of
the yy.dll reference is automatically set to true, so the
yy.dll will be copied to the output folder, which is the
same folder as the xx.exe, that means when I deploy the
application xx.exe, I must include the yy.dll to the same
folder as the xx.exe exists in, but I want the folder that
include the xx.exe(it's always the application root dir)
to be clean, how do I move the yy.dll to a subfolder, that
means I want to change the private assembly to a different
folder from the application folder.

Regards
Nov 22 '05 #1
4 3666
If you're using 1.1, you can load an assembly from a fixed path using
Assembly.LoadFi le() but you'd have to modify your code so that it creates
types from your other assembly this way.

I think you can use AppDomain.Curre ntDomain.Append PrivatePath to add a path
that will be used in the resolution process. I do believe it does not accept
relative paths though, so if this is a subfolder of your app's root folder
you'll have to get the full path. Or just use .\Bin?
--
_______________ _____
Klaus H. Probst, MVP
http://www.vbbox.com/

"Yang Liu" <an*******@disc ussions.microso ft.com> wrote in message
news:07******** *************** *****@phx.gbl.. .
Hi all,
I have a .net windows application xx.exe, which reference
a private assembly yy.dll, the property "local copy" of
the yy.dll reference is automatically set to true, so the
yy.dll will be copied to the output folder, which is the
same folder as the xx.exe, that means when I deploy the
application xx.exe, I must include the yy.dll to the same
folder as the xx.exe exists in, but I want the folder that
include the xx.exe(it's always the application root dir)
to be clean, how do I move the yy.dll to a subfolder, that
means I want to change the private assembly to a different
folder from the application folder.

Regards

Nov 22 '05 #2
If you're using 1.1, you can load an assembly from a fixed path using
Assembly.LoadFi le() but you'd have to modify your code so that it creates
types from your other assembly this way.

I think you can use AppDomain.Curre ntDomain.Append PrivatePath to add a path
that will be used in the resolution process. I do believe it does not accept
relative paths though, so if this is a subfolder of your app's root folder
you'll have to get the full path. Or just use .\Bin?
--
_______________ _____
Klaus H. Probst, MVP
http://www.vbbox.com/

"Yang Liu" <an*******@disc ussions.microso ft.com> wrote in message
news:07******** *************** *****@phx.gbl.. .
Hi all,
I have a .net windows application xx.exe, which reference
a private assembly yy.dll, the property "local copy" of
the yy.dll reference is automatically set to true, so the
yy.dll will be copied to the output folder, which is the
same folder as the xx.exe, that means when I deploy the
application xx.exe, I must include the yy.dll to the same
folder as the xx.exe exists in, but I want the folder that
include the xx.exe(it's always the application root dir)
to be clean, how do I move the yy.dll to a subfolder, that
means I want to change the private assembly to a different
folder from the application folder.

Regards

Nov 22 '05 #3
Hi

You can use the PrivateBinPath propeerty in the config
file for this. You can create subfolders inside your bin
folder and specify the subfolder path in the
privatebinpath element of the config file. This will hint
the runtime to search for tyhe assembly in the specified
subfolder at the time of assemblty locaton. Optinally as
Klaus suggested you can do the same thru coding also
using the AppDomain.Curre ntDomain.Append PrivatePath snippet
hth

regards,

sr

"Yang Liu" <an*******@disc ussions.microso ft.com> wrote in messagenews:07******* *************** ******@phx.gbl. ..
Hi all,
I have a .net windows application xx.exe, which reference a private assembly yy.dll, the property "local copy" of
the yy.dll reference is automatically set to true, so the yy.dll will be copied to the output folder, which is the
same folder as the xx.exe, that means when I deploy the
application xx.exe, I must include the yy.dll to the same folder as the xx.exe exists in, but I want the folder that include the xx.exe(it's always the application root dir)
to be clean, how do I move the yy.dll to a subfolder, that means I want to change the private assembly to a different folder from the application folder.

Regards

.

Nov 22 '05 #4
Hi

You can use the PrivateBinPath propeerty in the config
file for this. You can create subfolders inside your bin
folder and specify the subfolder path in the
privatebinpath element of the config file. This will hint
the runtime to search for tyhe assembly in the specified
subfolder at the time of assemblty locaton. Optinally as
Klaus suggested you can do the same thru coding also
using the AppDomain.Curre ntDomain.Append PrivatePath snippet
hth

regards,

sr

"Yang Liu" <an*******@disc ussions.microso ft.com> wrote in messagenews:07******* *************** ******@phx.gbl. ..
Hi all,
I have a .net windows application xx.exe, which reference a private assembly yy.dll, the property "local copy" of
the yy.dll reference is automatically set to true, so the yy.dll will be copied to the output folder, which is the
same folder as the xx.exe, that means when I deploy the
application xx.exe, I must include the yy.dll to the same folder as the xx.exe exists in, but I want the folder that include the xx.exe(it's always the application root dir)
to be clean, how do I move the yy.dll to a subfolder, that means I want to change the private assembly to a different folder from the application folder.

Regards

.

Nov 22 '05 #5

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

Similar topics

2
672
by: Yang Liu | last post by:
Hi all, I have a .net windows application xx.exe, which reference a private assembly yy.dll, the property "local copy" of the yy.dll reference is automatically set to true, so the yy.dll will be copied to the output folder, which is the same folder as the xx.exe, that means when I deploy the application xx.exe, I must include the yy.dll to the same folder as the xx.exe exists in, but I want the folder that include the xx.exe(it's always...
5
2405
by: Julie | last post by:
I'm currently working in a mixed mode project where the exe is C#, there is a managed C++ (DLL) assembly, that in part, includes some calls into a native (unmamanged) DLL. I can build/link/run just fine, the question isn't about that. What I'm after is, if I have another client that uses the C++ managed assembly, I want the unmanaged DLL somehow to tag along. I've looked at /link in AL.exe, and /assemblymodule, but either I'm not...
2
2311
by: Brad | last post by:
I have one of those seemingly simple questions that evades/confuses me. I've created an assembly with bass classes (classes meant to be inherited in other assemblys). In a secondary assembly (my business layer) I created a class which inherits from a base class in the first assembly....so far so good. If I create a third assembly (my UI layer) and add reference in it to the business layer and I access a public variable in the business...
3
4414
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here really understand how this could be an issue. The assemblies that the system is complaining about are ones that we build here and we're not changing version numbers on anything. The errors come and go with no apparent rhyme or reason. We do not...
0
1740
by: Ratul | last post by:
Hi all! I'm writing a winforms test harness which lets me specify a subfolder from which to load a particular .net assembly dll. The idea is that there will be multiple subfolders, each having this dll. To ensure that there are no conflicts with similarly named assembly dll files, I'm am trying to load a subdirectory's dll into its own AppDomain. However when I call the AppDomain.CreateInstanceFromAndUnwrap method, it throws an...
2
10961
by: Luis Arvayo | last post by:
I am compiling and executing c# code at runtime and I need to define in CompilerParameters.ReferencedAssemblies one of my own assemblies together with the standard System.dll u others. Example: // compiler options System.CodeDom.Compiler.CompilerParameters options = new System.CodeDom.Compiler.CompilerParameters(); options.GenerateExecutable = false; // result is a dll
2
2442
by: Sky | last post by:
Hello: I'm trying to make sense of snk files, when to use, under what conditions to regenerate new ones,...can someone take a look if these statemes make sense? And then the final questions at the end that they first statements bring up in my mind... a) Because two developers, unbeknownst to each other, can end up releaseing different dll's with the same name, one should sign an assembly with a unique tag. right?
1
3694
by: Tony Johansson | last post by:
Hello! If I select a private assembly in ILDASM I get a lot of information listed but if I select a shared assembly located at c:\window\assembly(GAC) I get nothing listed. So is this normal not seeing anything when using ILDASM on any shared assembly located in the GAC. Now to my second question: If I create a shared assembly from a private assembly and then use
7
10088
by: chage | last post by:
Hi, I have been searching around to try adding reference assembly to another assembly during runtime, programatically. Is this possible in .Net? The reason for this is because i am having trouble using a library that creates an instance of a Type that i specified, and it failed the locate the Type during runtime, if i do not reference it during compile time.
9
6351
by: =?Utf-8?B?VGhvbWFzIFcuIEJyb3du?= | last post by:
"parez" wrote: Assembly.LoadWithPartialName does indeed work!! Now, why is this incredibly useful routine deprecated and we are instructed to use Assembly.Load instead which does not provide the same functionality?!? I'll check now, but maybe someone knows... Is this deprecated routine still available in Visual Studio 2008 and .NET 3.5?
0
9541
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10484
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10251
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9072
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6805
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4141
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 we have to send another system
3
2938
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.