I suggest you ...

Make WinRT API usable in Portable Class Libraries targeting Windows 8 and WP8

Windows 8 API and Windows Phone 8 API is both based on Windows Runtime and it shares lot of common code. For some strange reason it's not possible to use any WinRT classes in Portable Class Libraries targeting Windows 8 and WP8.

Please make it possible for us developers to use classes like StorageFile, StorageFolder and others in PCL libraries to make the code reusability even better, thanks!

158 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Martin SuchanMartin Suchan shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →
    completed  ·  Visual Studio TeamAdminVisual Studio Team (Product Team, Microsoft) responded  · 

    That’s a great suggestion. We’ve added this capability for the new versions of both platforms. So when you author a portable class libraries with the following targets (or any subset) you’ll have access to WinRT APIs as well:

    - Windows 8.1
    - Windows Phone 8.1
    - Windows Phone Silverlight 8.1
    For the first two platforms, you’re also able to produce Windows Runtime components (WinMD).

    Immo Landwerth
    Program Manager
    .NET Framework Team

    3 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • sdormansdorman commented  ·   ·  Flag as inappropriate

        This contradicts the information here: http://msdn.microsoft.com/library/windows/apps/jj714086(v=vs.105).aspx#BKMK_WhattoshareinaPortableClasslibrary

        "Windows Runtime APIs aren’t portable and can’t be used in a Portable Class Library. There is overlap in the Windows Runtime APIs that are supported on Windows Phone 8 and Windows 8. However, binary compatibility is not supported. Your code has to be compiled for each platform and therefore isn’t suitable for a Portable Class Library. Here too you should abstract the use of Windows Runtime APIs into classes or objects that aren’t shared in a Portable Class Library."

        Was just a subset of the WinRT APIs made available or has this not actually shipped yet?

      Feedback and Knowledge Base