Quantcast
Channel: WE MOVED to github.com/nuget. This site is not monitored!
Viewing all articles
Browse latest Browse all 7612

Edited Feature: Add ability to force adding assembly binding redirects for select assemblies in package [1648]

$
0
0
Currently when a package gets installed assembly binding redirects get added to config only if there are other assemblies in the application that were bound against an earlier version of the assembly in my package. However, an application using my package could be referencing my assembly's identity in other ways, most notably from config (e.g. registering custom config sections, specifying custom types, etc).

This request is about allowing me as the package author to specify a list of assemblies should always have assembly binding redirects added (either in the nuspec file or maybe via some other manifest file).

For example, say there's an MVC 3 application that has a ~/Views/web.config file that registers a RazorHost config section. I use NuGet to install MVC 4 into my application, which adds the latest versions of the assemblies into bin. However, my application doesn't work because at runtime it's trying to load the 3.0 section (as specified in config) but the loaded assembly is 4.0.
The easiest solution is to add an assembly binding redirect in the root web.config. It would be nice if NuGet would do that automatically.

Note 1: It would be impractical to scan the entire application (at least a Web Application) to try to smartly determine if there are any web.configs that are referencing assemblies in my package because there could be a large number of those config files to scan. Using a list would be a lot more efficient.

Note 2: For assemblies in my package that are not on my list we probably would still want NuGet to do the reference scanning just in case something is referencing that assembly.

Viewing all articles
Browse latest Browse all 7612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>