OpenSource library – Cross-platform targeting

Part 1

Implement Open-source library guidance

Part 2

OpenSource library – Cross-platform targeting

Part 3

OpenSource library-Dependencies

Part 4

OpenSource library- Source Link

Part 5

OpenSource library-versioning

Part 6

OpenSource library- Breaking changes

Part 7

OpenSource library- conclusion

At https://docs.microsoft.com/en-us/dotnet/standard/library-guidance/cross-platform-targeting there are the recommendations  for Cross platform. Let’s see what needs to be done for https://github.com/ignatandrei/AOP_With_Roslyn

Let’s see:

 

Nr Recommandation AOP Roslyn
1 DO start with including a netstandard2.0 target. Done – the main dll, AOPRoslyn, is already .netstandard2,0
2 AVOID including a netstandard1.x target. Not needed
3 DO include a netstandard2.0 target if you require a netstandard1.x target. Not needed
4 DO NOT include a .NET Standard target if the library relies on a platform-specific app model. Not needed
5 CONSIDER targeting .NET implementations in addition to .NET Standard. Not needed
6 AVOID using multi-targeting with .NET Standard if your source code is the same for all targets. Not needed
7 CONSIDER adding a target for net461 when you’re offering a netstandard2.0 target. OK> see later point 9

 

8 DO distribute your library using a NuGet package. Done

https://www.nuget.org/packages/dotnet-aop

 

9 DO use a project file’s TargetFrameworks property when multi-targeting Struggle to implement/ partially done – modified AOPRoslyn.csproj
10 CONSIDER using MSBuild.Sdk.Extras when multi-targeting for UWP and Xamarin as it greatly simplifies your project file. Not needed
11 DO NOT include a Portable Class Library (PCL) target. OK
12 DO NOT include targets for .NET platforms that are no longer supported. Not needed

I tried to modify to include

<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>

( Attention: Framework, not Framework)

First , you should publish the .csproj

dotnet publish <path to csproj>

should be modified with -f=”netstandard2.0″

Then , each dependency should support it :

error NU1202: Package PortableConsoleLibs 1.0.0 is not compatible with net461 (.NETFramework,Version=v4.6.1). Package PortableConsoleLibs 1.0.0 supports: netcoreapp2.0 (.NETCoreApp,Version=v2.0)

So you should contact the owners to support it – or re-compile the sources, if you have.

So I will stick with

“DO NOT include targets for .NET platforms that are no longer supported.” including NET461.

Conclusion: 11 / 12 it is a good score.

Friday links 296

Implement Open-source library guidance

Part 1

Implement Open-source library guidance

Part 2

OpenSource library – Cross-platform targeting

Part 3

OpenSource library-Dependencies

Part 4

OpenSource library- Source Link

Part 5

OpenSource library-versioning

Part 6

OpenSource library- Breaking changes

Part 7

OpenSource library- conclusion

I have written previously a booklet about “Making Open Source Component from idea to deploy With examples from .NET Core” .

Now  Microsoft and contributors make a library guidance for OpenSource projects at https://docs.microsoft.com/en-us/dotnet/standard/library-guidance/  . I will take as a working point my component, https://github.com/ignatandrei/AOP_With_Roslyn , and see where it goes and how many things I already implemented.

The items are:

Cross-platform targeting   
Strong naming   
NuGet and open-source libraries   
Dependencies   
SourceLink   
Publishing   
Versioning   

I will implement each one in one blog post

My Async Await tutorials

Rule of thumb: just await / async from top to down.

 

To deeply understand async await in .NET Core , please follow the following resources:

 

1. https://channel9.msdn.com/Events/TechDays/Techdays-2014-the-Netherlands/Async-programming-deep-dive  – to gain inner knowledge about what code is async / await

2. Read https://blog.stephencleary.com/2012/02/async-and-await.html to have started into async await

3. Read MSDN for a better understanding : https://msdn.microsoft.com/en-us/magazine/jj991977.aspx?f=255&MSPPError=-2147217396

4. Common pitfalls in ASP.NET  Framework( not in console! ) with async await: https://blog.stephencleary.com/2012/07/dont-block-on-async-code.html

5. No problem in ASP.NET Core: https://blog.stephencleary.com/2017/03/aspnetcore-synchronization-context.html

Happy reading !

Andrei Ignat weekly software news(mostly .NET)

* indicates required

Please select all the ways you would like to hear from me:

You can unsubscribe at any time by clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp's privacy practices here.