Version mismatch for retail realm package
New update by retail realm provided a package that is targeting to .net6.0 framework but my application run on net standard framework 2.0 . Does RR supports is multi targeted frameworks and or are you able to provide RR that is compatible with .NET framework 2.0?
3 answers
-
Bruce (SqlWork.com) 84,086 Reputation points
RR is an independent company and not supported by this forum. You should contact them to determine support options. That said, it sounds like you are using the legacy Dynamics 365 Retail which has limited support. Perhaps it is time to migrate to Dynamics 365 Commerce which supports modern .net core assemblies.
-
Damien Pham (WICLOUD CORPORATION) 1,755 Reputation points • Microsoft External Staff • Moderator
Hello @Tiwana, Ramandeep ,
Thank you for sharing.
I cannot confirm Retail Realm's own packaging plans, but from the .NET/NuGet side, a package that only ships a
net6.0target is not a direct fit for a project that must stay onnetstandard2.0.NuGet selects package assets based on the target framework of the consuming project. If the Retail Realm package only contains
net6.0assets, NuGet has no compatible asset to use for anetstandard2.0project.The important distinction is that
netstandard2.0is a compatibility target used to share library code across supported .NET implementations, whilenet6.0is a modern .NET target. Microsoft’s .NET Standard guidance states that .NET 5 and later reduce the need for .NET Standard in most scenarios, but if a library needs to share code between .NET Framework and other .NET implementations,netstandard2.0is the recommended target.You can see the references here:
- .NET Standard
- Cross-platform targeting for .NET libraries
- Support multiple .NET frameworks in your project file
If your project must remain on
netstandard2.0, the practical next step is to ask the Retail Realm package owner whether they can publish a compatiblenetstandard2.0asset, or a multi-targeted package that includes bothnet6.0andnetstandard2.0, if their code can support that.If the package owner only provides
net6.0, then the consuming project/application would need to retarget to a compatible modern .NET target, or you would need to use an older package version that still contains compatible assets.I hope this helps. If you found my response helpful or informative, I would greatly appreciate it if you could follow this guidance or provide feedback.
Thank you.
-
AI answer
Retail Realm’s package that targets .NET 6.0 cannot be used directly in an application that targets .NET Standard 2.0. A .NET 6.0 assembly is not compatible “downwards” with .NET Standard 2.0; compatibility flows the other way (for example,
net6.0is compatible withnetstandard2.0, not vice versa).For a NuGet package to be usable from a .NET Standard 2.0 application, the package must either:
- Target
netstandard2.0(or another framework compatible with your app’s target), or - Be multi-targeted and include a
netstandard2.0assembly alongside thenet6.0assembly.
When a package supports multiple frameworks, all assemblies for compatible frameworks must expose the same or a superset of the API surface so that consumers can compile against one TFM and run against another without
MissingMethodExceptionorTypeLoadException.In this case, to use Retail Realm from a .NET Standard 2.0 application, Retail Realm would need to ship a multi-targeted package that includes a
netstandard2.0build (or another framework compatible with your app). Without such a compatible TFM in the package, the .NET Standard 2.0 application cannot consume the .NET 6.0-only package.
References:
AI-generated content may be incorrect. Read our transparency notes for more information. - Target
