-
Notifications
You must be signed in to change notification settings - Fork 520
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
Duplicate references to framework assemblies added #1333
Comments
I guess we still need Choose Nodes, but need to merge all the packages... |
I wonder why it installed the references at all. Usually it should not add the reference if it already finds one which doesn't have a Paket flag. (this would also lead to a workaround) |
I've also already noticed this behavior, but since it leads to no problems during the build and the result assemblies also have no problems at runtime and it's only weird display in the Solution Explorer, I haven't reported this one ;) Currently a To deduplicate the nodes, we would need to collect framework references together with the conditions when each of it should be inserted and provide separate |
I have the same behavior. If you add to an empty F# project nuget packages - Although I have 3
packet.lock:
|
can you please zip that sample project and attach it here? thanks |
Yes, it is in attachment. |
Ok one System.Xml.Linq.dll is coming from FSharp.Data and one from Microsoft.WindowsAzure.Storage we could somehow store if we already emitted the reference for a given framework and only reference it once. So it would be ommited for Microsoft.WindowsAzure.Storage. Is it worth it? |
I believe this goes into the category of "should fix". It's (I believe) mostly harmless but it's something that can confuse users and is not expected. |
so what do we do? removing the second reference? Reordering choose nodes by grouping by target framework (see @mexx 's comment) is not what I want to do before we know how nuget is doing this in vNext. |
I think this is very similar to #932, if not actually exactly the same thing.
When adding a package to a project using Paket, a
<Choose>
section is added to the project file with references to all the assemblies in that package, as well as apparently any of the framework assemblies that are stated as dependencies in the package but not already referenced by the project. When the next package is added, those references to the framework assemblies are not found and added again in that package's<Choose>
section.An example:
FsXaml and FSharp.Desktop.UI reference the following framework assemblies:
I now use Paket to add those to a project that already references
System.Xaml
,System.Xml
andWindowsBase
(added through the References dialog, for example).Adding FSharp.Desktop.UI now inserts the following into the
*.fsproj
file:Next I add FsXaml;
System.Xaml
,System.Xml
andWindowsBase
are detected correctly, but the other two framework assembly references are not "seen" and get included again for FsXaml:The result is that the respective framework assemblies show up multiple times in Solution Explorer; however, as far as I could see, the project still compiles and runs correctly, probably because they are always references to the exact same thing and thus don't cause conflicts as seen in #932.
My naive first thought would of course be simply putting all references to framework assemblies in normal ItemGroups, but considering we're dealing with Visual Studio, MSBuild and NuGet, that sounds too easy.
The text was updated successfully, but these errors were encountered: