-
Notifications
You must be signed in to change notification settings - Fork 526
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
Some dll (System.Net.Http) references twice in csproj #2352
Comments
yes something is broken there <Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
<ItemGroup>
<Reference Include="System.Net.Http">
<Paket>True</Paket>
</Reference>
<Reference Include="System.Net.Http.Formatting">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client\lib\net45\System.Net.Http.Formatting.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose> and later <Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
<ItemGroup>
<Reference Include="System.Core">
<Paket>True</Paket>
</Reference>
<Reference Include="System.Net.Http">
<HintPath>..\packages\System.Net.Http\lib\net46\System.Net.Http.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose> |
We are struggling with this also. Related to https://github.com/dotnet/corefx/issues/11100 we are trying to use version found in nuget (4.3.2) instead of the one in GAC. After uninstalling the original reference and installing the nuget with paket we ended up to this exact situation. Manually removing the reference before System.Net.Http.Formatting seemed to temporarily resolve the issue (getting us to other version mismatches related to netstandard, but they are another story...) |
Have this same problem. Removing the following reference to the GAC from the .csproj file fixes it:
However it returns as soon as |
Will try to take a look at this later today or during the weekend |
mhm I just tried to run paket update on the attached zip and it only references System.Net.Http via the GAC. And only once. What am I missing? |
We have a direct reference to the https://www.nuget.org/packages/System.Net.Http/ nugget in our project, you could try adding that to the project. We are using net461. |
yes then we have the duplicates - which is no wonder tbh. |
possible solution in #2628 |
Seems like #2628 fixed the duplicate System.Net.Http references (awesome :D). However I can't remember having the following bug before, maybe #2628 introduced it? This is a project that holds a reference to the System.Net.Http NuGet package: After running C:\Projects\SomeProject [b_paketbugquestionmark +0 ~1 -0 !]> git diff
diff --git a/src/Some.Project.IntegrationTests/app.config b/src/Some.Project.IntegrationTests/app.config
index 87a6834..c109a94 100644
--- a/src/Some.Project.IntegrationTests/app.config
+++ b/src/Some.Project.IntegrationTests/app.config
@@ -11,6 +11,11 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
+ <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.3.0.0" />
+ </dependentAssembly>
+</assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
@@ -74,10 +79,5 @@
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
-</assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
- <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.3.0.0" />
- </dependentAssembly>
</assemblyBinding></runtime>
</configuration>
\ No newline at end of file So I commit it and run C:\Projects\SomeProject [b_paketbugquestionmark +0 ~1 -0 !]> git diff
diff --git a/src/Some.Project.IntegrationTests/app.config b/src/Some.Project.IntegrationTests/app.config
index c109a94..87a6834 100644
--- a/src/Some.Project.IntegrationTests/app.config
+++ b/src/Some.Project.IntegrationTests/app.config
@@ -11,11 +11,6 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
- <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.3.0.0" />
- </dependentAssembly>
-</assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
@@ -79,5 +74,10 @@
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
+</assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.3.0.0" />
+ </dependentAssembly>
</assemblyBinding></runtime>
</configuration>
\ No newline at end of file
C:\Projects\SomeProject [b_paketbugquestionmark +0 ~1 -0 !]> git cmm "cm2" It changed it back. So I commit it and run another C:\Projects\SomeProject [b_paketbugquestionmark +0 ~1 -0 !]> git diff
diff --git a/src/Some.Project.IntegrationTests/app.config b/src/Some.Project.IntegrationTests/app.config
index 87a6834..c109a94 100644
--- a/src/Some.Project.IntegrationTests/app.config
+++ b/src/Some.Project.IntegrationTests/app.config
@@ -11,6 +11,11 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
+ <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.3.0.0" />
+ </dependentAssembly>
+</assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
@@ -74,10 +79,5 @@
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
-</assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
- <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.3.0.0" />
- </dependentAssembly>
</assemblyBinding></runtime>
</configuration>
\ No newline at end of file If I keep going |
Yes please post a repro sample. Something is fucky
Am 21.08.2017 10:48 vorm. schrieb "Nikolai Norman Andersen" <
[email protected]>:
… Seems like #2628 <#2628> fixed
the duplicate System.Net.Http references (awesome :D). However I can't
remember having the following bug before, maybe #2628
<#2628> introduced it? This is a
project that holds a reference to the System.Net.Http NuGet package:
After running paket install I can see it change the location of the
FSharp.Core binding redirect:
C:\Projects\SomeProject [b_paketbugquestionmark +0 ~1 -0 !]> git diff
diff --git a/src/Some.Project.IntegrationTests/app.config b/src/Some.Project.IntegrationTests/app.config
index 87a6834..c109a94 100644
--- a/src/Some.Project.IntegrationTests/app.config
+++ b/src/Some.Project.IntegrationTests/app.config
@@ -11,6 +11,11 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
+ <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.3.0.0" />
+ </dependentAssembly>
+</assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
@@ -74,10 +79,5 @@
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
-</assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
- <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.3.0.0" />
- </dependentAssembly>
</assemblyBinding></runtime>
</configuration>
\ No newline at end of file
So I commit it and run paket install again:
C:\Projects\SomeProject [b_paketbugquestionmark +0 ~1 -0 !]> git diff
diff --git a/src/Some.Project.IntegrationTests/app.config b/src/Some.Project.IntegrationTests/app.config
index c109a94..87a6834 100644
--- a/src/Some.Project.IntegrationTests/app.config
+++ b/src/Some.Project.IntegrationTests/app.config
@@ -11,11 +11,6 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
- <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.3.0.0" />
- </dependentAssembly>
-</assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
@@ -79,5 +74,10 @@
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
+</assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.3.0.0" />
+ </dependentAssembly>
</assemblyBinding></runtime>
</configuration>
\ No newline at end of file
C:\Projects\SomeProject [b_paketbugquestionmark +0 ~1 -0 !]> git cmm "cm2"
It changed it back. So I commit it and run another paket install to see
if we can go full circle:
C:\Projects\SomeProject [b_paketbugquestionmark +0 ~1 -0 !]> git diff
diff --git a/src/Some.Project.IntegrationTests/app.config b/src/Some.Project.IntegrationTests/app.config
index 87a6834..c109a94 100644
--- a/src/Some.Project.IntegrationTests/app.config
+++ b/src/Some.Project.IntegrationTests/app.config
@@ -11,6 +11,11 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
+ <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.3.0.0" />
+ </dependentAssembly>
+</assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
@@ -74,10 +79,5 @@
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
-</assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
- <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.3.0.0" />
- </dependentAssembly>
</assemblyBinding></runtime>
</configuration>
\ No newline at end of file
If I keep going paket install switches the assemblyBinding every time. If
you think it's unrelated I'll post another bug.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#2352 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNHyJjyuT9RWjffjfomqBb3D2VuEiks5saURbgaJpZM4Ng4_d>
.
|
Our solution targets .NET 4.6.1 and at the top of paket.dependencies we have Framework: net461 with redirects: on.
We reference .Net and .Net Core packages:
After packet intall , System.Net.Http referenced twice in .csproj .
Compilation Error:
Bindings:
Simple project is in attachement:
PaketWebApp.zip
No workaround found for the moment.
The text was updated successfully, but these errors were encountered: