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 4 3626
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
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
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
.
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
. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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:...
|
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...
|
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...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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...
|
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...
|
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...
|
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...
| |