473,320 Members | 1,945 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 3616
If you're using 1.1, you can load an assembly from a fixed path using
Assembly.LoadFile() 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.CurrentDomain.AppendPrivatePath 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*******@discussions.microsoft.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.LoadFile() 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.CurrentDomain.AppendPrivatePath 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*******@discussions.microsoft.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.CurrentDomain.AppendPrivatePath snippet
hth

regards,

sr

"Yang Liu" <an*******@discussions.microsoft.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.CurrentDomain.AppendPrivatePath snippet
hth

regards,

sr

"Yang Liu" <an*******@discussions.microsoft.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
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...
5
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...
2
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...
3
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...
0
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...
2
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:...
2
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...
1
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...
7
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...
9
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...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.