I have migrated to NET 8.0 all my NET 4.6.2 projects, except one that's a VTSO Add-in project (Office). Since Web Office addins is the only option offered in NET Core and doesn't have all the features I need for that project, I have no choice to remain in NET Framework for that specific project.
So, I have bundles all the libraries I used commonly and put them in a NETStandard 2.0 library project so it can be used in both NET Core projects, and this one NET Framework project. Which seemed to work just fine, EXCEPT...
There was a conflict between "netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" and "netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51". 8> "netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" was chosen because it was primary and "netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" was not. 8> logMessageDetails= References which depend on "netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" [C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\8.0.7\ref\net8.0\netstandard.dll]. 8> C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\8.0.7\ref\net8.0\netstandard.dll 8> Project file item includes which caused reference "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\8.0.7\ref\net8.0\netstandard.dll". 8> C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\8.0.7\ref/net8.0/netstandard.dll
NETStandard 2.1 is inherently in NET 8.0, so even though NETStandard 2.0 is supported in NET 8.0, it gives conflict error.
Libraries references by NETStandard are also conflicting:
There was a conflict between "System.ComponentModel.Annotations, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.ComponentModel.Annotations, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
There was a conflict between "System.Management, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
I'm hoping there is a way around that, isn't it supposed to be the purpose of NETStandard to be able to share pieces of code such as interfaces and models, between .NET Core and .NET Framework?
.NET 4.6.2is not the newest .net framework version. Have you considered swithing that to.net 4.8.1?netstandard2.0andnetstandard2.1in that library project. In the.csprojyou can conditionally add different versions of the same library depending on the target framework. So your .NET Framework VSTO project will use thenetstandard2.0version and all your .NET 8 projects will use thenetstandard2.1version.