Click here to Skip to main content
15,895,871 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a set of baseclasses in a .Net 4.5 project. Now we also need those baseclasses in another .Net 5 project. I can move these classes to their own assembly to avoid redundancy, however that assembly will not be compatible to one of the projects, no matter which of the two frameworks I choose. Redundancy is a big concern here, so please no 'hacky' solutions like synchronizing sources between project or anything else which tries to make redundancy practical.

What I need is a common ground, some framework version that would be compatible to both frameworks. Would perhaps .Net Standard be an option.

What I have tried:

Honestly, nothing yet. Extracting the classes to their own assembly is easy enough, but it's useless if there is no compatible framework version.
Posted
Updated 28-Apr-22 1:32am

1 solution

Make a .Net Standard library. Here is Microsoft's docs on cross framework compatibility. Choose the one that best suits your needs: .NET Standard | Microsoft Docs[^]
 
Share this answer
 
Comments
CodeWraith 28-Apr-22 8:48am    
Thanks, I'm going to try it right now.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900