Is moving over to a Portable Class Library a breaking change?
-
03-06-2021 - |
문제
At the moment I am building separate binaries to target each runtime
- .net 4
- Windows Phone
- Silverlight
Now if I move the library over to be a single Portable Class Library, and I am not changing the functionality, is this considered a breaking change?
Or in SemVer terms is it a major, minor or patch version change?
해결책
I would say this is a minor version change because code which links against your library is now subject to some specific whims of the PCL:
When you deploy a .NET Framework 4 application that references a Portable Class Library assembly, you must specify a dependency on the .NET Framework 4 update. By specifying this dependency, you ensure that the update is installed with your application.
Also, if you have exposed certain Framework types, consumers of the code may need to change.
다른 팁
Yes and no. As sixlettervariables called out, if previously targeting 4.0, yes, it is a breaking change to move to portable because you now have a dependency on a .NET Framework Update that you previously didn't. With the other platforms (or if targeting .NET 4.0.3 or higher), no, it not a breaking change.
While in theory this should be a minor change in reality it is a little more complicated.
Speaking form experience I have had several issues with upgrading assemblies to Portable class Libraries. These include:
- IIS with .net 4 would not load an PCL assembly because it could not find "System.Core".
- Mono 2.10 has issues with Portable Class Libraries. Rumoured to be fixed in Mono 2.12 http://www.mono-project.com/Release_Notes_Mono_2.12
These are most likely teething issues that will be solved in the future. But just be mindful of the possible upstream issues you may cause consumers of your library.
I would say if you can simply drop the new assembly in and everything just continues to work like it did before without any code modifications, then it's not a breaking change.
Switching to a PCL is a fairly neutral operation from the library consumer's perspective. It's still just a class library to them.
In semver terms, I think it would count as a minor version.