Connecting Tech Pros Worldwide Help | Site Map

PrivateBinPath

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 22nd, 2005, 12:29 PM
mark heywood
Guest
 
Posts: n/a
Default 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

  #2  
Old November 22nd, 2005, 12:30 PM
Sijin Joseph
Guest
 
Posts: n/a
Default Re: PrivateBinPath

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:[color=blue]
> 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[/color]
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.