Can I tell bindingRedirect to always use the latest available version?

Having an ASP.NET application there are several entries in the Web.Config file in this format:

<dependentAssembly>
    <assemblyIdentity name=WebGrease publicKeyToken=31bf3856ad364e35 >
    <bindingRedirect oldVersion=0.0.0.0-1.6.5135 newVersion=1.6.5135 >
<dependentAssembly>

These libraries come as NuGet packages.

Now every time I update my 20+ NuGet packages I do something like:

  1. One click to update all packages.
  2. Open the application in browser.
  3. See errors like this one.
  4. Open my Web.Config, find the binding redirect entry.
  5. Lookup the assemblies latest version.
  6. Modify my web.config.
  7. Update those stepse 2..6 for all other updated NuGet packages with binding redirects.

This is very annoying.

My question:

Is there a way to tell the

bindingRedirect

entry to always use the latest version?

E.g. something like:

<bindingRedirect oldVersion=0.0.0.0-* newVersion=* >

(Using a wildcard to tell the latest version)

The closes I came accross is something like:

<bindingRedirect oldVersion=0.0.0.0-9.9.9.9 newVersion=1.6.5135 >

(Only specify the newest version once)

View More Answer And Comment : Stackoverflow


Top Answer 1

Unfortunately, the answer to this is no. See the bindingRedirect element on MSDN.

To quote:

oldVersion: Required attribute.

Specifies the version of the assembly that was originally requested. The format of an assembly version number is major.minor.build.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: Required attribute.
Specifies the version of the assembly to use instead of the originally requested version in the format: n.n.n.n

This value can specify an earlier version than oldVersion.

View More Answer And Comment : Stackoverflow

JavaScript countdown until date

So I'm trying to build a very minimalistic countdown timer until a specific date (2015 July 31, 18:00:00 GMT) including total MS until the date, as well as a D:H:M:S:MS until the date. What I got so [Read More...]

Access nav bar button in code

I have a button on the right side of my nav bar, it is a Done button. I created it on my storyboard. I am trying to disable it in code. How can I access this button? View More Answer And Comment [Read More...]

Pagination of PHP echoed Content

PHP is an alien language for me. I am trying to pull some fields from WP's SQL database.. The content comes out okay but is a lot. I want to somehow put it in a HTML carousel or some slider, where [Read More...]

Open/closing lines in Eclipse IDE

Is there a way to enable (like in other text editors) the vertical (normally doted) lines that marks/guides you where for example an "if"/method/etc opens and closes? Thanks. View More Answer [Read More...]

How to run Servlet on Github?

I have dynamic web project which I have made using Eclipse IDE and working correctly on tomcat. But when I uploaded the project on Github its servlets are not loading however HTML files are working [Read More...]

riak wont start after changing nodename

I've just installed riak on my virtual machine (Ubuntu 14.04). The problem is that when I've edited /etc/riak/riak.conf from: nodename = [emailprotected] to nodename = [Read More...]