Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bindingRedirect in Asp.net vNext

Tags:

asp.net-core

How can I achieve a binding redirect in asp.net vnext? Before I would have configured the bindingRedirect using xml in the web.config file, but I can find how to to this in the Project.json

https://github.com/aspnet/Home/wiki/Project.json-file

like image 476
Michael Dudley Avatar asked Jan 16 '15 15:01

Michael Dudley


People also ask

What is bindingRedirect in web config?

To redirect one assembly version to another, use the <bindingRedirect> element. The oldVersion attribute can specify a single assembly version or a range of versions. The newVersion attribute should specify a single version. For example, <bindingRedirect oldVersion="1.1.

What is auto generate binding redirects?

Binding redirects are added if your app or its components reference more than one version of the same assembly, even if you manually specify binding redirects in the configuration file for your app. The automatic binding redirection feature affects desktop apps that target . NET Framework 4.5. 1 or a later version.


2 Answers

Binding redirects are not needed in ASP.NET 5. The loader in ASP.NET 5 will automatically load the correct DLL based on project references and the available NuGet and project references.

Or, if you have a case that doesn't work, please provide more details.

like image 179
Eilon Avatar answered Sep 20 '22 18:09

Eilon


According to David Fowler from the ASPNET team, binding redirects are gone and not coming back. I created a GitHub issue and he thinks this needs to be done at the Roslyn level (basically, don't output this warning anymore).

https://github.com/aspnet/Home/issues/407

like image 36
Tom McKearney Avatar answered Sep 22 '22 18:09

Tom McKearney