I have run into an issue with assembly versions vs. NuGet package versions and dealing with multiple assemblies (versioned differently) within a single package. I am sure this is a common issue, but I haven’t found any good solution, so I am hoping we can provide some guidance around this scenario. Let me explain.
Prism has a core PCL that is shared across all supported platforms. Prism supports 3 platforms and has a different NuGet package for each platform; UWP, Xamarin.Forms, and WPF. Prism also has support for different DI containers and uses the same NuGet packages for each platform but each assembly is versioned differently.
Let me see if I can clarify this a little:
- Prism.Core.dll is a PCL that ships in the Prism.Core NuGetPackage. This assembly is versioned separately from the other assemblies n the overall product.
- Prism.Wpf.dll is in the Prism.WPF NuGet package.
- Prism.Windows.dll is in the Prism.Windows NuGet package.
- Prism.Forms.dll is in the Prism.Forms NuGet package.
So far so good. nothing really complicated yet. But now, let’s introduce the support DI container packages.
- Prism.Unity NuGet package has different assemblies for each platform and has dependencies on the platform specific packages mentioned above as well as the Prism.Core package.
Now, here is the issue. Let’s say that we have these versions:
As you can see each assembly can be versioned differently. So how do we update the NuGet packages when only one assembly changes? We have a major issue trying to increment the NuGet package version, when only one assembly in the package has updated.
For example, let’s say that the PrismUnity.Forms.dll got a bug fix and went to v2.0.2, but the current Prism.Unity NuGet package is versioned at v3.0.0 because of the update to the Prism.Unity.Wpf.dll assembly. Also, when the Prism.Unity package it updated, it’s dependencies must be updated, and any other platform will be prompted for an update, even though that platform assembly may not have changed.
So the question is, how do you recommend versioning Nuget packages when it contains differently versioned assemblies for different platforms. Do we just increment the version of every assembly in the package to be in sync even though nothing may have changed in the code for that assembly?
I hope I explained that well enough. If not, please ask any clarifying questions.