473,385 Members | 2,274 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,385 software developers and data experts.

PrivateBinPath

ANyone know how to set up the PrivateBinPath in visual
studio for when you are deploying a C# Windows Application
so it looks in other places for assemblies?

Or how to combine a config file into the project so I can
write the private path xml myself?

Cheers

Mark
Nov 22 '05 #1
1 6195
From the MSDN documentation

.NET Framework Developer's Guide

Specifying an Assembly's LocationSee Also
Assemblies | Programming With Assemblies | How the Runtime Locates
Assemblies | Configuring Applications
There are two ways to specify an assembly's location:

Using the <codeBase> element.
Using the <probing> element.
You can also use the .NET Framework Configuration Tool (Mscorcfg.msc) to
specify assembly locations or specify locations for the common language
runtime to probe for assemblies.

Using the <codeBase> Element
You can use the <codeBase> element only in machine configuration or
publisher policy files that also redirect the assembly version. When the
runtime determines which assembly version to use, it applies the code
base setting from the file that determines the version. If no code base
is indicated, the runtime probes for the assembly in the normal way. For
details, see How the Runtime Locates Assemblies.

The following example shows how to specify an assembly's location.

<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="myAssembly"
publicKeyToken="32ab4ba45e0a69a1"
culture="en-us" />
<codeBase version="2.0.0.0"
href="http://www.litwareinc.com/myAssembly.dll"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
The version attribute is required for all strong-named assemblies but
should be omitted for assemblies that are not strong-named. The
<codeBase> element requires the href attribute. You cannot specify
version ranges in the <codeBase> element.

Note If you are supplying a code base hint for an assembly that is not
strong-named, the hint must point to the application base or a
subdirectory of the application base directory.
Using the <probing> Element
The runtime locates assemblies that do not have a code base by probing.
For more information about probing, see How the Runtime Locates Assemblies.

You can use the <probing> element in the application configuration file
to specify subdirectories the runtime should search when locating an
assembly. The following example shows how to specify directories the
runtime should search.

<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin;bin2\subbin;bin3"/>
</assemblyBinding>
</runtime>
</configuration>
The privatePath attribute contains the directories that the runtime
should search for assemblies. If the application is located at
C:\Program Files\MyApp, the runtime will look for assemblies that do not
specify a code base in C:\Program Files\MyApp\Bin, C:\Program
Files\MyApp\Bin2\Subbin, and C:\Program Files\MyApp\Bin3. The
directories specified in privatePath must be subdirectories of the
application base directory.

See Also
Assemblies | Programming With Assemblies | How the Runtime Locates
Assemblies | Configuring Applications
Syntax based on .NET Framework version 1.1.
Documentation version 1.1.0.
--------------------------------------------------------------------------------

Send comments on this topic.

© 2001-2002 Microsoft Corporation. All rights reserved.

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph

mark heywood wrote:
ANyone know how to set up the PrivateBinPath in visual
studio for when you are deploying a C# Windows Application
so it looks in other places for assemblies?

Or how to combine a config file into the project so I can
write the private path xml myself?

Cheers

Mark

Nov 22 '05 #2

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

Similar topics

2
by: Vincenzo Davi | last post by:
I have created a dll with several classes in C#. One of the classes references image files in the subdirectories of the bin/Release folder (basically where the dll resides). Now, I want to use...
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...
1
by: mark heywood | last post by:
ANyone know how to set up the PrivateBinPath in visual studio for when you are deploying a C# Windows Application so it looks in other places for assemblies? Or how to combine a config file into...
0
by: Mr 071 | last post by:
I am trying to use shadow copying provided by the framework, but I am not able to get it to work. More specifically, after a new app domain is created and the assembly loaded in it, it is still not...
1
by: Jon Davis | last post by:
AppDomainSetup has "PrivateBinPath" property. How do I apply something like this for the current AppDomain, so that I can load the dependencies of an assembly I am loading which are in the same...
5
by: Benny Raymond | last post by:
What should I do instead of this: AppDomain.CurrentDomain.AppendPrivatePath(Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath) + @"\plugins"); now that...
1
by: Paul Newman | last post by:
I have been hosting ASP.Net in my app for some time, with no problems, with framework 1.1 (VS 2003). Having just upgraded to 2.0 (VS 2005), and it now gives this error: HttpException...
12
by: Eric Renken | last post by:
I have an application that I am adding support for plug-ins and I am looking for some help on the best way to handle this. My question has to do with AppDomains and the best way to use them. I...
0
by: RobinS | last post by:
I have a license for a 3rd party component that has different versions for debug and release, but the same name. To automate the build and deployment, I put the debug version of the license in a...
1
by: pzero24 | last post by:
Ok so I am making plugins for my application and I have the plugins located in a subdirectory: /AppDir /AppDir/Plugins All my plugins reference a Plugins interface file, which is also located...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
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
0
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...
0
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
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...
0
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...

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.