Switch From PCLs to .NET Standard
See original GitHub issueSummary
Microsoft has officially deprecated Portable Class Libraries, which is what Duality is based on with regard to portability. Projects still compile just fine and will for the foreseeable future, but it will get progressively harder and less intuitive to keep things working and expanding on it. Consider switching all PCL projects to .NET Standard for v3.0.
Analysis
- Duality PCLs use Profile111, which is equivalent to .NET Standard 1.1. Use this standard version for maximum compatibility.
- Check which VS version is minimum required to create and build .NET Standard 1.1 libraries using the new reduced
csproj
format. Don’t use the.json
format, seems pretty much deprecated by now. - Be careful how NuGet packages are referenced. The
csproj
PackageReference
item is not supported for all project types yet, see here. Might be better to stick topackages.config
for now. - Consider doing a full switch to VS 2017 and the new project system as part of this change.
- Check which VS version is minimum required to create and build .NET Standard 1.1 libraries using the new reduced
- .NET Standard packages require at least NuGet 2.12 or 3.4, so the Duality package manager will need to be updated to this first. The new
csproj
package reference format requires at least NuGet 4.0.- It may also need to handle platform-dependent dependency scenarios.
- Make sure that Duality packages continue to be able to reference regular NuGet packages.
- Figure out how the NuGet package specs for Duality packages need to be changed in order in order to properly identify as netstandard packages.
- Get proficient with how .NET Standard works combined with regular .NET Framework applications and libraries when it comes to dependencies and runtime behavior.
- Make sure the editor doesn’t get spammed with .NET Framework specific forward-only assemblies.
- Make sure the deployed launcher still works on platforms it worked before, like Linux and MacOS via Mono.
- What’s the role of reference assemblies in this?
- Some links for further research:
- https://stackoverflow.com/questions/42254288/referencing-a-net-standard-library-from-a-windows-class-library
- https://stackoverflow.com/questions/44617898/how-do-you-reference-a-net-standard-library-from-a-net-framework-4-5-console-a
- https://github.com/dotnet/standard/issues/410
- https://github.com/dotnet/standard/issues/481
- https://www.hanselman.com/blog/ReferencingNETStandardAssembliesFromBothNETCoreAndNETFramework.aspx
- https://github.com/dotnet/standard/issues/146#issuecomment-271105398
- https://docs.microsoft.com/en-us/nuget/guides/create-net-standard-packages-vs2017
- https://docs.microsoft.com/en-us/nuget/guides/create-net-standard-packages-vs2015
- Projects to switch:
- FarseerDuality
- NVorbis
- Duality / Core
- Primitives
- Compatibility
- Tilemaps (core and sample)
- All sample projects
- The game plugin template
- Note that it might also be required to change the AppVeyor CI settings to run in a new environment. Check the current settings to see which VS version is used.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:40 (32 by maintainers)
Top Results From Across the Web
How to Convert a PCL Library to .NET Standard and Keep ...
It is time to convert those old PCL libraries to new .NET Standard libraries! It is so easy to do and takes only...
Read more >Converting PCL (Portable Class Libraries) to .NET ...
1) Go to the original folder of your PCL project. · 2) Open Visual Studio 2017 and create a new solution/project by choosing...
Read more >Converting Portable Class Libraries (PCL) to .NET Standard ...
It is time to convert those old PCL libraries to new . NET Standard libraries! It is so easy to do and takes...
Read more >Upgrade PCL to .NET Standard Class Library
Upgrade PCL to .NET Standard Class Library · Delete your packages. · Right click, and press Unload Project · Right click, and press...
Read more >How to convert a PCL (Portable) project to NetStandard
The first step was, of course, opening the project in Visual Studio 2017. If you are on an older VS version, you should...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Some MS docs on multi-targeting platforms with .NET Standard: https://docs.microsoft.com/en-us/dotnet/standard/library-guidance/cross-platform-targeting
One point to note is that they explicitly recommend not targeting any 1.x standard version unless there is a specific older platform that would otherwise be unsupported. Might be worth it to reconsider the 1.x target after verifying exactly which platforms and potential future platforms would be affected.
Made a issue for this: https://github.com/AdamsLair/duality/issues/737 We should tackle that issue after we complete this one.