473,587 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can application policy bind to latest version of assembly?

Is there a way to set the application binding policy so
that it always binds to the latest version of an
assembly? I'm hoping there is a way to avoid updating the
application's binding configuration every time there is
an update to a shared assembly.

Jul 19 '05 #1
2 8786
SR
Use the BindingRedirect Element in the config file. MSDN
Link : http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/cpgenref/html/gngrfbindingred irect.asp

<msdn_snip>

..NET Framework General Reference

<bindingRedirec t> Element
Redirects one assembly version to another.

<configuratio n>
<runtime>
<assemblyBindin g>
<dependentAssem bly>
<bindingRedirec t>

<bindingRedirec t
oldVersion="old assembly version"
newVersion="new assembly version"/>
Required Attributes
Attribute Description
oldVersion Specifies the version of the assembly that was
originally requested. The format of an assembly version
number is major.minor.bui ld.revision. Valid values for
each part of this version number are 0 to 65535.
You can also specify a range of versions in the following
format:

n.n.n.n - n.n.n.n

newVersion Specifies the version of the assembly to use
instead of the originally requested version in the format:
n.n.n.n

Remarks
When you build a .NET Framework application against a
strong-named assembly, the application uses that version
of the assembly at run time by default, even if a new
version is available. However, you can configure the
application to run against a newer version of the
assembly. For details on how the runtime uses these files
to determine which assembly version to use, see How the
Runtime Locates Assemblies.

You can redirect more than one assembly version by
including multiple <bindingRedirec t> elements in a
<dependentAssem bly> element.

Explicit assembly binding redirection in an application
configuration file requires a security permission. This
applies to redirection of .NET Framework assemblies and
assemblies from third parties. The permission is granted
by setting the <bindingRedirec t> Element flag on the
SecurityPermiss ion Class. For more information, see
Assembly Binding Redirection Security Permission.

Example
The following example shows how to redirect one assembly
version to another.

<configuratio n>
<runtime>
<assemblyBindin g xmlns="urn:sche mas-microsoft-
com:asm.v1">
<dependentAssem bly>
<assemblyIdenti ty name="myAssembl y"

publicKeyToken= "32ab4ba45e0a69 a1"
culture="neutra l" />
<bindingRedirec t oldVersion="1.0 .0.0"
newVersion="2.0 .0.0"/>
</dependentAssemb ly>
</assemblyBinding >
</runtime>
</configuration>
Configuration File
This element can be used in the application configuration
file, machine configuration file (machine.config ), and the
publisher policy file.

See Also
Runtime Settings Schema | Configuration File Schema |
Redirecting Assembly Versions

</msdn_snip>

Hope this helps

regards,

sr
-----Original Message-----
Is there a way to set the application binding policy so
that it always binds to the latest version of an
assembly? I'm hoping there is a way to avoid updating the
application' s binding configuration every time there is
an update to a shared assembly.

.

Jul 19 '05 #2
Right. But, this doesn't give you the latest available version - you have
to specify the newVersion, with no wildcards. This is by design, and for
good reason - always using the latest version causes dll hell (see
http://blogs.gotdotnet.com/suzcook/P...3-56c29a59b22d )
..

But, if the problem is that you're changing your assembly version for every
build, you may want to consider keeping them the same, and then only
changing them after each shipping build. See
http://blogs.gotdotnet.com/suzcook/P...8-65f3eac85274
for details.
Suzanne Cook
My .NET CLR Loader blog: http://blogs.gotdotnet.com/suzcook/
--
Please do not respond directly to this alias. This alias is for newsgroup
purposes only. This posting is provided "AS IS" with no warranties, and
confers no rights.

"SR" <rs*****@hotmai l.com> wrote in message
news:05******** *************** *****@phx.gbl.. .
Use the BindingRedirect Element in the config file. MSDN
Link : http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/cpgenref/html/gngrfbindingred irect.asp

<msdn_snip>

.NET Framework General Reference

<bindingRedirec t> Element
Redirects one assembly version to another.

<configuratio n>
<runtime>
<assemblyBindin g>
<dependentAssem bly>
<bindingRedirec t>

<bindingRedirec t
oldVersion="old assembly version"
newVersion="new assembly version"/>
Required Attributes
Attribute Description
oldVersion Specifies the version of the assembly that was
originally requested. The format of an assembly version
number is major.minor.bui ld.revision. Valid values for
each part of this version number are 0 to 65535.
You can also specify a range of versions in the following
format:

n.n.n.n - n.n.n.n

newVersion Specifies the version of the assembly to use
instead of the originally requested version in the format:
n.n.n.n

Remarks
When you build a .NET Framework application against a
strong-named assembly, the application uses that version
of the assembly at run time by default, even if a new
version is available. However, you can configure the
application to run against a newer version of the
assembly. For details on how the runtime uses these files
to determine which assembly version to use, see How the
Runtime Locates Assemblies.

You can redirect more than one assembly version by
including multiple <bindingRedirec t> elements in a
<dependentAssem bly> element.

Explicit assembly binding redirection in an application
configuration file requires a security permission. This
applies to redirection of .NET Framework assemblies and
assemblies from third parties. The permission is granted
by setting the <bindingRedirec t> Element flag on the
SecurityPermiss ion Class. For more information, see
Assembly Binding Redirection Security Permission.

Example
The following example shows how to redirect one assembly
version to another.

<configuratio n>
<runtime>
<assemblyBindin g xmlns="urn:sche mas-microsoft-
com:asm.v1">
<dependentAssem bly>
<assemblyIdenti ty name="myAssembl y"

publicKeyToken= "32ab4ba45e0a69 a1"
culture="neutra l" />
<bindingRedirec t oldVersion="1.0 .0.0"
newVersion="2.0 .0.0"/>
</dependentAssemb ly>
</assemblyBinding >
</runtime>
</configuration>
Configuration File
This element can be used in the application configuration
file, machine configuration file (machine.config ), and the
publisher policy file.

See Also
Runtime Settings Schema | Configuration File Schema |
Redirecting Assembly Versions

</msdn_snip>

Hope this helps

regards,

sr
-----Original Message-----
Is there a way to set the application binding policy so
that it always binds to the latest version of an
assembly? I'm hoping there is a way to avoid updating the
application' s binding configuration every time there is
an update to a shared assembly.

.

Jul 19 '05 #3

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

Similar topics

8
2257
by: JohnnySparkles | last post by:
Hi All, I'm working on an application which uses a dll for some of its classes. I build the application and the dll and it runs fine on any machine with Visual Studio .NET installed on it. Once you take the application and the dll and place them on a machine without Visual Studio .NET the application throws the following error: Unhandled Exception: System.IO.FileNotFoundException: File or assembly name
3
11503
by: Raveendra | last post by:
Hi! I am trying to create one new Application Domain and calling one Assembly in that created Application Domain. It is working fine with stand alone application. But I need to do the same with ASP.NET. In brief I will explain: I want to create one Application domain, and call one assembly in that created application domain, and excute some methods/functions of that calling assembly and unload the application domain. All these things...
9
1886
by: Wayne Wengert | last post by:
I built an ASP application and it runs fine on my local IIS. I am trying to move the application to my web service (ISP) out on the internet. I've read several of the help articles but they all seem to think I am deploying to localhosts. I created a new directory on my web page and copied most of the files from the wwwroot subdirectory where my project exists. When I try to open the page (by pointing to "WebForm1.aspx in the new...
0
1051
by: john wright | last post by:
I am trying to solve a problem and have been directed here. I am developing a Web App using the 1.1 framework. I am using the Enterprise Application Blocks for this program (espcially the data access block). Everything is working well, except when I add new controls or code I get this error. To resolve the error, I have to close down my development environment, stop the server and clear the Temporary ASP.NET files for my project. Does...
4
430
by: Terence Shek | last post by:
Is there a way to set the application binding policy so that it always binds to the latest version of an assembly? I'm hoping there is a way to avoid updating the application's binding configuration every time there is an update to a shared assembly.
2
1282
by: Tinnu | last post by:
My asp.net application uses a class which needs an unmanaged dll named SSlibrary. When trying to load the page it gives me the folllowing error. === Pre-bind state information === LOG: DisplayName = SSLLibrary (Partial) LOG: Appbase = file:///c:/inetpub/wwwroot/Licmanager LOG: Initial PrivatePath = bin Calling assembly : (Unknown).
2
285
by: junkmanuk | last post by:
Hi, This has been posted many times, but no solutions I've found so far have helped! I'm getting this message from my ASP.NET app: The application has been running fine for months, yet at 12:30 last Saturday it upped and died. We've tried rebooting the server, checking permissions on directories, removing temporary asp.net files... nothing
2
4158
by: Onur | last post by:
Hi.All I'm working on a TTS application. It runs on my local pc (WindowXP pro) without any error. Microsoft Visual Studio .NET 2003, Microsoft .NET Framework SDK v1.1, Microsoft Speech Application SDK 1.1. are installed on my local pc. My web server is Windows 2003 server Enterprise. Microsoft .NET Framework Version:1.1 and Microsoft Speech Server 2004 are installed on the server.
0
7924
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7854
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
8219
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
8349
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...
1
7978
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
5722
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5395
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
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2364
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

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.