Sitelet https://github.com/fsprojects/Paket/pull/1187
Skip to content

Adds binding redirect for applicable assemblies only - #1187

Merged
forki merged 5 commits into
fsprojects:masterfrom
mrinaldi:binding_redirect_referenced_only
Nov 4, 2015
Merged

forki merged 5 commits into
fsprojects:masterfrom
mrinaldi:binding_redirect_referenced_only

Conversation

@mrinaldi

@mrinaldi mrinaldi commented Nov 3, 2015

Copy link
Copy Markdown
Contributor

Fixes #809.

/cc @isaacabraham

@forki

forki commented Nov 3, 2015

Copy link
Copy Markdown
Member

I think there is an issue with using things like /binding-redirect-adds-referenced-assemblies-only/before/Project1/Project1.fsproj

when I run paket install for the main Paket project then this will get affected.

we should rename fsproj files in the before folder to fsprojtemplate and remove the suffix when we copy the files to temp.

@isaacabraham

Copy link
Copy Markdown
Contributor

In terms of behaviour, am I correct in thinking that rather than inserting BRs from all dependencies, it now checks what dependencies there are for each project one by one, and generates specific BRs for each of them?

@forki

forki commented Nov 3, 2015

Copy link
Copy Markdown
Member

Just to clarify: my comment was only referring to the integration tests. We
need to protect integration test data against run of paket update from the
root of the repo.
On Nov 3, 2015 1:26 PM, "Isaac Abraham" notifications@github.com wrote:

In terms of behaviour, am I correct in thinking that rather than inserting
BRs from all dependencies, it now checks what dependencies there are for
each project one by one, and generates specific BRs for each of them?

—
Reply to this email directly or view it on GitHub
#1187 (comment).

@mrinaldi
mrinaldi force-pushed the binding_redirect_referenced_only branch from 8c9d44d to 142e28d Compare November 3, 2015 12:41
@mrinaldi

mrinaldi commented Nov 3, 2015

Copy link
Copy Markdown
Contributor Author

oops 😊

done in 142e28d

@mrinaldi

mrinaldi commented Nov 3, 2015

Copy link
Copy Markdown
Contributor Author

@isaacabraham kind of. It doesn't generate BRs for each referenced dependency, but for required referenced dependency only.

That means it'll only generate BRs for dependencies that are referenced and have a higher version than the version required for another assembly.

For example:
AutoFixture.Xunit 3.36.9 requires xunit.extensions ≥ 1.8.0.1549 && < 2.0.0, but references xunit.extensions 1.8.0.1549.

This PR will only generate BRs when needed. That means if a project has a dependency on AutoFixture.Xunit 3.36.9 but depends on xunit.extensions 1.9.2, it'll generate BR for xunit.extensions.

However, if the project references AutoFixture.Xunit 3.36.9 and xunit.extensions 1.8.0.1549, no BR will be generated.

@isaacabraham

Copy link
Copy Markdown
Contributor

@mrinaldi so that's even better than what I was thinking - basically the minimal set of BRs that are required. LGTM.

@forki

forki commented Nov 3, 2015

Copy link
Copy Markdown
Member

is there something we should write into the docs?

@forki

forki commented Nov 3, 2015

Copy link
Copy Markdown
Member

/cc @dnauck

@dnauck

dnauck commented Nov 3, 2015

Copy link
Copy Markdown
Contributor

What about transient dependencies that needs BRs?

E.g. Dependency 1 has transient dependency on Newtonsoft.Json 5.x and Dependency 2 has transient dependency on Newtonsoft.Json 6.x ?

Looks like your PR (just read the text here) will not generate a BR for Newtonsoft.Json in this case but this is required.

@mrinaldi

mrinaldi commented Nov 3, 2015

Copy link
Copy Markdown
Contributor Author

@dnauck actually, it does.

Using this paket.dependencies

source https://www.nuget.org/api/v2/

nuget PushoverQ.Json
nuget Newtonsoft.Json.Schema

And this paket.references

PushoverQ.Json
Newtonsoft.Json.Schema

This is the resulting app.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-999.999.999.999" newVersion="7.0.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="Microsoft.ServiceBus" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-999.999.999.999" newVersion="3.0.0.0" />
  </dependentAssembly>
</assemblyBinding></runtime></configuration>

@mrinaldi

mrinaldi commented Nov 4, 2015

Copy link
Copy Markdown
Contributor Author

Added 7b3533e to make sure that even if --createnewbindingfiles is specified, the app.config is not created if no binding redirect is required.

@mrinaldi

mrinaldi commented Nov 4, 2015

Copy link
Copy Markdown
Contributor Author

@forki We can improve the docs describing the new behavior, albeit the old behavior is not described.
In my opinion, however, the current docs are ok.

forki added a commit that referenced this pull request Nov 4, 2015
Adds binding redirect for applicable assemblies only
@forki
forki merged commit 659a827 into fsprojects:master Nov 4, 2015
@forki

forki commented Nov 4, 2015

Copy link
Copy Markdown
Member

cool! thanks so much!

@mrinaldi
mrinaldi deleted the binding_redirect_referenced_only branch November 4, 2015 12:44
@mrinaldi mrinaldi mentioned this pull request Dec 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants