Tuesday, February 05, 2013

How portable is your assembly? Check it with the PCL Compliance Analyzer!

Vagif Abilov's blog on .NET - Check your code portability with PCL Compliance Analyzer

I am extracting parts of my Simple.Data OData adapter to make a portable class library (PCL). The goal is to create an OData library available for desktop .NET platforms, Windows Store, Silverlight, Windows Phone and even Android/iOS (using Xamarin Mono). To study platform-specific PCL capabilities I used an Excel worksheet provided by Daniel Plaisted (@dsplaisted). It’s a very helpful document, but it would be much easier if I could simply point some tool to an assembly file and it would show its portable and non-portable calls.

I haven’t found such tool, so I wrote one. It’s called PCL Compliance Analyzer. Select an assembly file, set of platforms you want to target, and it will show you if the assembly is PCL compliant and what calls are not. Here are the results for Mono.Cecil (that I used to scan assembly calls):



PCL Compliance Analyzer is an open-source project hosted at GitHub, and if you only need its binaries, you can download them here [GD: Click through and scroll down to the bottom for the GitHub and download links...].

That's awesome. And the fact its source has also been shared makes it awesome++


Related Past Post XRef:
Need a refresher on what Portable Class Library Projects are? (For your co-workers of course, since YOU know about them already... right?)
GoTo Portable Class Libraries - Now's the time to start using them as your default Class Project template?
Update 4.0.3 for Microsoft .NET Framework 4 Roundup
Write (.Net library) once, use everywhere (in .Net world)? The Portable Library Tools CTP Released. (Think “Reusing/Sharing the same Project between SilverLight, XNA, Windows Phone, etc” or “DRY .Net Project Style” )

No comments: