Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable functionality for "Automatically Add Binding Redirects" #1147

Closed
RaptorCZ opened this issue Aug 10, 2015 · 7 comments
Closed

Disable functionality for "Automatically Add Binding Redirects" #1147

RaptorCZ opened this issue Aug 10, 2015 · 7 comments
Assignees
Labels
Functionality:SDK The NuGet client packages published to nuget.org Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Type:DCR Design Change Request
Milestone

Comments

@RaptorCZ
Copy link

I want to be able to disable this. Why? I have solutions with multiple projects and assembly bindings are defined in external config file and linked with linkedConfiguration to web/app configs. I don't want NuGet adds assemblyBinding section to configs and edits all configs when package gets update or added.

@yishaigalatzer
Copy link

I was thinking about this same scenario, and I can see why you want to do it.

I do have a question however: If your config is the same across multiple projects, are your package versions the same?

if they are the same - Then updating binding redirects should work correctly.

How do you plan to resolve it?

CC @Pilchie @davidfowl If we choose to implement this, them for project.json scenarios we will need some common setting between NuGet and the project system.
If they are not the same - The config file is not applicable to all projects.

@RaptorCZ
Copy link
Author

Yes, versions are the same :-) And it is because I'm working on large solution with multiple webs based on the same framework. Final webs are using the same version of assemblies as whole framework. There is no way how to use in final application more assemblies of different version.

So I just want to add references to package A to many other projects and use assembly binding in main web config. I can handle all package updates on my own, because that's how it works. Just update package on whole solution (or solutions - because it is modular framework) and update config. Then publish web with this config. Final web should contain assemblies from different solutions too, so nuget will never update all configs.

And other thing is - when I add package A to project XYZ, I don't want allow nuget system to touch any other projects and modify configs. Well, there should be some option for nuget to do it, but never ever do it as default. After every add or modify project using nuget I have to go a discard MANY changes to other project in solution. Mostly it is just added config section with bindings even configuration exists and is linked as extenal config.

@yishaigalatzer yishaigalatzer added this to the Client-VNext milestone Aug 11, 2015
@yishaigalatzer yishaigalatzer added Functionality:SDK The NuGet client packages published to nuget.org Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Type:DCR Design Change Request and removed Viewed labels Aug 11, 2015
@yishaigalatzer
Copy link

Thanks for the explanation, this is something we could look at in one of the future releases.

@GrahamTheCoder
Copy link

+1, we never want binding redirects - we ship a set of dlls with correct references.

NuGet incorrectly insists we need bindings, tries to add them, performs very slowly doing so, and chucks out warnings of "item with the same key is already added". When it's finally finished we just delete all the app.configs from within solution explorer. It seems like adding a disable option in nuget.config will be easier than fixing all the problems with the feature. As a side note, does app.config even have any effect for dlls?

@yishaigalatzer yishaigalatzer modified the milestones: 3.3.0-Beta, Client-VNext Oct 21, 2015
@yishaigalatzer yishaigalatzer self-assigned this Oct 21, 2015
@yishaigalatzer
Copy link

Turns out this is simpler to implement that getting the repro steps from #1580 :)

@yishaigalatzer
Copy link

Design:

  1. Add two options in nuget.config
  2. Expose the first option in the UI
  3. skip binding redirects when the option is checked, warn by default on failures instead of fail.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  ...
  <bindingRedirects>
    <add key="skip" value="False" />
    <add key="successRequired" value="False" />
  </bindingRedirects>
</configuration>

image

yishaigalatzer pushed a commit to NuGet/NuGet.Client that referenced this issue Oct 21, 2015
NuGet/Home#1147

Add two options in nuget.config
Expose the first option in the UI
skip binding redirects when the option is checked, warn by default on failures instead of fail.

Will follow up with a docs PR
yishaigalatzer pushed a commit to NuGet/NuGet.Client that referenced this issue Oct 21, 2015
NuGet/Home#1147

Add two options in nuget.config
Expose the first option in the UI
skip binding redirects when the option is checked, warn by default on failures instead of fail.

Will follow up with a docs PR
@GrahamTheCoder
Copy link

Wow, awesome, that was like a 12 hour turnaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:SDK The NuGet client packages published to nuget.org Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Type:DCR Design Change Request
Projects
None yet
Development

No branches or pull requests

3 participants