-
Notifications
You must be signed in to change notification settings - Fork 358
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
"Found conflicts between different versions of the same dependent assembly" despite AutoGenerateBindingRedirects ON #1598
Comments
We'll try to repro and see if there is a workaround possible or if there is an actual issue needing fixed. |
Updated all my webjobs with |
I took a look at this, and here's what's happening:
To fix this, the Microsoft.Web.WebJobs.Publish package should probably save the value of MSBuild should also fix the issue where it can generate a warning telling you to set To workaround this issue, you can put the following in your .csproj file after all of the .targets imports: <PropertyGroup>
<AutoUnifyAssemblyReferences>true</AutoUnifyAssemblyReferences>
</PropertyGroup> |
Can this be related in any way? https://devblogs.microsoft.com/visualstudio/using-newtonsoft-json-in-a-visual-studio-extension/ |
What's the status of this? I think I'm facing this same issue with a project migrated from NetCore 2.2.100 to NetCore 3.1.201 and the proposed workaround #1598 (comment) doesn't work for me. |
@dsplaisted - "F5" like the networking device? Also linking this because of similar convo |
By default, F5 is the shortcut key in Visual Studio to "Start Debugging". In classic ASP.NET projects, when starting debugging, Visual Studio would not do a full build where it copied the content and web.config to an output directory. Rather it would use those files from the project directory, so there was no opportunity to inject binding redirects during the build process. |
I'm also seeing this issue in my webjob. Can you get this fixed? |
@nicholastic Have you tried the workaround here? |
@dsplaisted Yes, unfortunately workaround #1598 (comment) doesn't work for me. |
@nicholastic Can you share a binlog of the failing build (with the workaround applied)? |
To add on to @dsplaisted's solution, if you are building using <!-- This is in a target because it must run after Microsoft.WebApplication.targets is imported -->
<!-- https://github.com/Azure/azure-webjobs-sdk/issues/1598#issuecomment-468501905 -->
<Target Name="_WebJobAutoUnifyAssemblyReferences" BeforeTargets="ResolveAssemblyReferences">
<PropertyGroup>
<AutoUnifyAssemblyReferences>true</AutoUnifyAssemblyReferences>
</PropertyGroup>
</Target> |
Hi @ggirard07 , Can we know if this is still persisting, we apologize for not following up frequently. |
@v-anvari we no longer have that mixed solution with .Net Core / .Net Framework projects. So going to close it. |
I recently migrated my solution to .Net Core with .netstandard 2.0. The only project still using .Net Framework 4.6.1 is my webjob (a console app project) because the NuGet package for the WebJobs SDK supporting .Net Standard is still in preview (3.0-beta4).
My solution is working properly but I can' t get ride of this last warning:
In order to get the NuGet package management right when mixing a class library in .Net Standard with an executable still in full framework, I had to update the console app project to use
PackageReference
instead ofpackages.config
, as explained here. I uninstalled every packages in the packages.config prior to switch toPackageReference
and then reinstalled only the required packages. For theMicrosoft.Web.WebJobs.Publish
package, I used the workaround detailed in #1109 asPackageReference
does not support PowerShell installation.I found the following announcement describing a similar pattern generating this kind of warning. But it does not cover my warning as the console application is an executable and is already using
AutoGenerateBindingRedirects
.Repro steps
Clone the repository containing the reproduction sample at https://github.com/ggirard07/bindingredirect.
Open the solution
BindingRedirectIssue.sln
.Build the solution (Build > Rebuild Solution).
Check the build errors and warnings.
Expected behavior
No error or warning should be produced.
Actual behavior
A warning is reported about assembly version conflicts.
Known workarounds
None.
Related information
The issue starts when adding the
Microsoft.Web.WebJobs.Publish
package to the solution.The warning seems to be related to a conflict about the
Newtonsoft.Json.dll
.There should be no conflict in the solution as everyone is using
Newtonsoft.Json
in version9.0.1
.The only reference to a different version is in the
Microsoft.Web.WebJobs.Publish
which use6.0.4
. it is used only during the build by the added .targets, there is no impact at runtime. This is also why theMicrosoft.Web.WebJobs.Publish
does not define any dependency to theNewtonsoft.Json
package.I am pretty sure this assembly,
$(NuGetPackageRoot)Microsoft.Web.WebJobs.Publish\1.1.0\tools\Newtonsoft.Json.dll
raises the issue because as soon as you remove thewebjob-publish-settings.json
file from the disk or thewebjobs.targets
from the console app csproj, the warning disappear (but you can no longer build the webjob...).Versions involved:
The text was updated successfully, but these errors were encountered: