A Brief Look at the .NET Portability Analyzer

Sign in to queue

Description

.NET is going through some monumental changes! It is often difficult to even begin to think about how to port our particular code to the various flavors of .NET. In this video Taylor Southwick and Connie Yau spend some time discussing a great tool that will definitely help in this difficult process. I was impressed with how easy it was to ascertain trouble spots that might cause issues when attempting to port libraries over to a more lightweight portable profile. Would love your comments!

Tag:

.NET

Embed

Download

The Discussion

  • User profile image
    LeRenard242

    will the ApiPort (.NET Portability Analyzer: https://github.com/Microsoft/dotnet-apiport) be included in the cli, or be exposed as a tool/command we can use with the cli? E.g.: dotnet analyze <..>

  • User profile image
    terrajobst

    @LeRenard242: That's a great suggestion!

    I think for now we're trying to keep the dotnet command pristine and avoid letting it become too much of a dumping ground. However, I don't see why this wouldn't work in the future. AFAIK, if API port is named dotnet-analyze and in the path, dotnet analyze should work (similar to how git works).

     

  • User profile image
    LeRenard242

    @terrajobst:cool, thx for that tip, interesting to try it out once the tools hit rtm!

  • User profile image
    dcuccia

    I'm 30 seconds in, and already excited. Thank you for bringing this tool to market. As a Silverlight and WPF dev, this is critical to understand where my apps need to change, and what sort of work is involved. Of particular interest is UWP for Windows 10 IoT on Raspberry Pi 2, and Xamarin.

  • User profile image
    dcuccia

    Great video and tools! So, two questions having now watched the whole thing:

    1. Could this service someday be integrated with Roslyn for providing in-line portability information and suggestions (or even transformations)?
    2. What's the chance that this can be extended to XAML markup? IIRC there have been efforts to suggest SL/WPF => UWP mappings. Since it appears to be very pluggable, would also be great to see mapping suggestions (or transformations) to/from Xamarin Forms.
    3. Is the OSS framework generic enough that it would allow API developers a scaffold to offer insights in portability either between it's own API surface (e.g. between versions), or even between it's API surface and that of another framework?
  • User profile image
    terrajobst

    @dcuccia:Sorry for the delay. I was confused which two of the three questions I should answer (6)

    1. Yes, we're playing around with the idea of provide an analyzer.

    2. That's an interesting suggestion.

    3. Are you asking whether our suggestion engine could be extended to incorporate non-platform libraries? We've talked about this recently and came to the conclusion that it should be possible as our engine used string-based IDs to refer to APIs.

    These are all excellent ideas. I suggest you file issues on GitHub so we can talk about them there in more detail!

    https://github.com/microsoft/dotnet-apiport

  • User profile image
    PradeepNair

    Super Awesome tool guys. Keep up the good work. 

  • User profile image
    Alberto Salazar

    Please help with this error:

    Microsoft (R) .NET Portability Analyzer 1.0.0.0 (alpha)
    Copyright (C) Microsoft Corporation. All rights reserved.
    More information is available at http://go.microsoft.com/fwlink/?LinkId=506955


    An unknown error occured.
    System.IO.FileNotFoundException: No se puede cargar el archivo o ensamblado 'System.Collections.Immutable, Version=1.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ni una de sus dependencias. El sistema no puede encontrar el archivo especificado.
    File name: 'System.Collections.Immutable, Version=1.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
    at ApiPortVS.Analyze.ApiPortVsAnalyzer.<GetApiPortOptions>d__8.MoveNext()
    at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
    at ApiPortVS.Analyze.ApiPortVsAnalyzer.GetApiPortOptions(IEnumerable`1 assemblyPaths, IEnumerable`1 formats, String reportFileName)
    at ApiPortVS.Analyze.ApiPortVsAnalyzer.<WriteAnalysisReportsAsync>d__7.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
    at ApiPortVS.Analyze.ProjectAnalyzer.<AnalyzeProjectAsync>d__9.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at ApiPortVS.AnalyzeMenu.<AnalyzeProjectsAsync>d__6.MoveNext()

Add Your 2 Cents