Your extension will be available shortly on the Visual Studio Marketplace at this link.

Portable Library Tools 2

Microsoft Free

Provides tools for Visual Studio 2010 for creating class libraries that run on Windows, Silverlight, Windows Phone and Xbox 360.

4.5 Star
Visual Studio
Download (95,811)
E-mail Twitter Digg Facebook
Add to favorites
Sign in to write a review
Sort by:

5 Star
by Alex F. Sherman | September 08 2011

5 Star
by Yamok-Sauce | August 24 2011

Great, just great!!

5 Star
by samiq | August 10 2011

has a lot of promise and I see it taking a lot of importance after the 3 screens strategy gets unveiled in BUILD - so we hope :)

there are some important things missing in this first release but at the same time it let us start acommodating for a near future

5 Star
by DexterouslyLive | June 15 2011

Ok, I like what it is possible with Portable Class Library. Great thinking but why are some things that seem basic to all the platforms missing? I understand that its a preview but really how extensive will this get. Will this develop to be a platform in which we can rely from all others?

It needs more consistency, for example: Timeout.Infinite is missing, and it doesn't seem to be all that hard to create that constant.

I will await future versions of this! For now, just keep your essential classes extremely basic.

Update: Been using Release Candidate and it is great. Keep up the good work and please add more namespaces such as System.XML.Linq.


BCL Team May 09 2012
| Edit |

The new update includes support for XLINQ when targeting 4.0.3 and higher.

4 Star
by StoneFactory | June 01 2011

Definitively a tool we needed.

Seems to be quite powerful but your are going to be faced with lost of requests for missing. For exemple, I need System.Xml.Lind to be able to factorize service references.

And what about extensions libraries?
Have you considered making it configurable with some kind of Xml file? Doing this, we could decorate assemblies, classes, methods, overloads with platform informations.

5 Star
by Josue Yeray | April 24 2011

Funciona muy bien, siempre y cuando mantengamos nuestras clases compartidas lo suficientemente sencillas.

Espero que evolucione un poco más para permitirnos más libertad de movimientos, pero aun así en su versión actual es una gran ayuda al desarrollo multi proyecto.

21 - 26 of 26 Items   
Sign in to start a discussion

  • System.Numerics.BigInteger and System.Numerics.Complex
    1 Posts | Last post August 05, 2014
    • Looks very strange, that BigInteger and Complex types are available in Profile 111 (Net 4.5, Win8, WP8.1) and Profile 47 (Net 4.5, Win8, Silverlight 5), but is not available in Profile 255 (Net 4.5, Win8, Silverlight 5, WP8.1) that is just combination of two previous.
  • .resx breaks portability ?
    3 Posts | Last post June 15, 2014
    • Hello,
      I'm trying to share some .resx files (public, EmbeddedResource) thru a PCL (between SL and .NET), but when I try to load some resource in SL, I get: 
      Error 4004 - System.IO.FileNotFoundException - Could not load file or assembly '<PCL_assemblyname>'.
      If I just have some constants in PCL, it works OK. I googled for more than an hour, but couldn't find any direction to go. Did anybody had a similar problem ?
    • Oooops, looks like I fell into a bug where your namespace/assembly can't be called xxx.resources... Pretty weird... Anyway, solved now !
    • That's a crazy gotcha - I just ran in to it myself with Visual Studio 2013, Silverlight / ASP.NET project with a Portable Class Library named "[something].Resources". Gotta love those..
  • INotifyCollectionChanged
    1 Posts | Last post May 16, 2014
    • Why is INotifyCollectionChanged missing when the project target includes both Silverlight 5 and Windows Phone 8.l (with or without any other target combination)?
  • WP 7.1 APIs not visible
    5 Posts | Last post April 16, 2013
    • Are there any plans to support the System.Net.Sockets namespace in the future?
    • Thanks for the feedback Andreas, we'll consider including them in a future update.
    • Hi David
      Thanks, that's good to hear. I guess supporting the mentioned namespace would require the addition of WP 7.1 as a 5th platform, right?
    • Hello.
      What's the status of Socket support? It's really needed for portable game engine development.
    • There are no plans to add Socket support anytime soon.
  • PCL in VS2012 incorrectly resolves mscrolib version in netmodule references
    7 Posts | Last post February 16, 2013
    • I have two PCL libraries with the same profile (88). One library is a netmodule (/terget:module) and the second one is a normal dll. The second library has a project reference to the first library. After tinkering with .csproj, the libraries build fine, but I get the following warnings:
      2>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3268: The primary reference "A:\_All\My.Creativity.Coding\Ark.Pipes\Ark.Weak\bin\Debug\Ark.Weak.netmodule" could not be resolved because it has an indirect dependency on the framework assembly "mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETPortable,Version=v4.0,Profile=Profile88". To resolve this problem, either remove the reference "A:\_All\My.Creativity.Coding\Ark.Pipes\Ark.Weak\bin\Debug\Ark.Weak.netmodule" or retarget your application to a framework version which contains "mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089".
      2>  Primary reference "mscorlib, Version=, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes".
      2>      Resolved file path is "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile88\mscorlib.dll".
      2>      Reference found at search path location "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile88\mscorlib.dll".
      Here is the csc.exe command line for the netmodule:
      C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702,2008 /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG;TRACE /errorendlocation /preferreduilang:en-US /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile88\mscorlib.dll" ---skipped--- /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\Ark.Weak.netmodule /target:module /utf8output Ark\DelegateExtens
    • This looks like a C# bug, it's outputting a reference to the wrong Mscorlib. Investigating and will get back to you.
    • Hmmm. Looks like you're right. ILdasm shows two mscorlib references.
      .assembly extern retargetable mscorlib
        .publickeytoken = (7C EC 85 D7 BE A7 79 8E )
        .ver 2:0:5:0
      .assembly extern mscorlib as mscorlib_2
        .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
        .ver 4:0:0:0
    • Spoke to the compiler team. They are aware of the bug, and were unable to fix it this release due to compatibility requirements (they actually attempted to fix it and had to roll it back because a few internal teams broke because of it).
      Unfortunately, I don't have a very good workaround, other than manually stripping the reference via something like ildasm/ilasm. :(
    • Thanks for the info. Turned out, netmodules are not suitable for my goal (I needed ILmerge instead), so that's no longer a problem for me.
    • Hi David,
      is there a connect issue to track this bug?
      Are there any known circumstances for this bug to arise or not?
      Also other projects now have this problem (e.g.
    • I have created a Microsoft Connect issue:
  • Inheritence from ObservableCollection<T> work SL5 but not .NET 4.5
    10 Posts | Last post January 23, 2013
    • When defining the BaseObservable below in a Portable Library (target: SL 5.0 & .NET 4.5):
      public interface IChild
              string Name { get; set; }
      public class BaseObservable<T> : ObservableCollection<T> where T : IChild
      The code works fine when referencing the portable library from SL5, but when I reference it from a .NET (4.5) class library I get the following error:
      The type 'System.Collections.ObjectModel.ObservableCollection`1<T0>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Windows, Version=, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes'.
    • For reference: 
      I'm using VS 2012
      Version 11.0.51106.01 Update 1
      Microsoft .NET Framework
      Version 4.5.50709
    • You need to add a reference to System.Windows (new for 4.5) from the .NET 4.5 project. It's needed to tell the compiler where the "real" location of ObservableCollection<T> is.
    • Great David, thanks for a fast reply, you just made my day!
      Is there any documentation where this kind of info could be found that I have missed?
    • With this particular issue, no. Is there any reason you didn't make the connection between the error message and adding the reference itself? (so that we can see if we can clear that up somehow?)
    • I think I was just so focused on that it worked so well when I compiled against the SL5 platform and the stress of a major refactoring was in vain, that I thought there was some mismatch in the portability lib, so that I had to go and play some ping pong. When I arrived back you have already given me the answer to my prayers. :)
      A small 5 point list troubleshooter with common pitfalls, if possible would be great! 
      Thanks again and have a nice day!
    • Can I get a clarification on this solution, please?  The error says it's expecting 2.0.5...I have the same issue (portable library targeting 4.5 + SL5 + Store Apps - referenced by a 4.5 project), but I have a reference to in my framework 4.5 project (version 4.0...I don't see 4.5)...point being, it seems to want an OLD version of see that this relates to another thread here where there is an incorrect mscorlib being referenced...Is there an easy way out of this box?  Note - it only happens when I add Silverlight 5 to the portable library.  If I compile with 4.5 + Store Apps then it works just fine...
      I'm really at a loss without a solution to this...I can do an IList workaround, but then I lose the collection changed events.
    • Unfortunately, we couldn't get this error message fixed to state what it is actually expecting. Adding a reference to the version of System.Windows is correct.
    • Well, I came in today renamed some projects, and closed and re-opened the solution and now it's building fine (it didn't make sense that it didn't work in the first place)...There seems to be some issues with modifying the project targeting not getting flushed/rebuilt correctly.  Now I'm being told that types defined in "system.runtime" are not available, i.e. System.Enum, System.Action, etc...Not having as much luck here, but I assume it will work out with enough cleaning, closing, etc...
      Thanks for the response...
    • I take that back...Most of it, anyway - I did something stupid and didn't add the System.Windows reference in another assembly...The System.Enum thing was still weird though, and has fixed itself after deleting all obj and bin folders.
      Thanks again.
  • Covariance/contravariance on WP7 platforms.
    1 Posts | Last post January 12, 2013
    • Can something be done with interface covariance/contravariance? When I add WP7 as a supported platform, the life gets harder since I can no longer use covariance/contravariance. I thought that it was supported by CLR/IL for a long tome, but was only added to C# in the 4.0 version. Can you please add support for that for the WP7 platform?
      example code which doesn't compile for WP7:
      new List<object>().AddRange(new List<string>());
  • PCL does not include WindowsRuntimeSystemExtensions
    1 Posts | Last post December 15, 2012
    • I'm trying to create a Portable Class Library with the following line of code in it:
      StorageFolder guidesLocalFolder = await ApplicationData.Current.LocalFolder.GetFolderAsync(guidesFolder);
      This requires the GetAwaiter method which is found in the WindowsRuntimeSystemExtensions class in the System.Runtime.WindowsRuntime.dll, but this dll is not available in the .NET Portable Subset. This seems strange to me as it is in the .NET for Windows Store apps component set and in the Windows Phone 8 component set, which are the two platforms I'm trying to target, would it be possible for Microsoft to add it, or is there some other constraint I'm missing? 
  • MessageContractAttribute isWrapped not defined ?
    2 Posts | Last post December 04, 2012
    • Hello,
      I'm attempting to create a Portable Library project which can be leveraged by both Silverlight and WPF applications. I have added a Service Reference for a 3rd party Web Service to my Portable project, but I'm running into a problem. Now, my SOAP request has a Wrapper on it, which causes the web service request to fail - malformed SOAP request / unexpected elements.
      I investigated the auto-generated client stub code and it seems there's a subtle difference between how it is generated in a regular Silverlight project and how it appears in a PCL project:
      Client Stub in Portable Library project:
          [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "")]
      Client Stub in regular Silverlight project:
          [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "")]
      I tried modifying the client stub and adding the "IsWrapped=false" property, but that property is undefined in the Portable project! Can anyone tell me why this is?
      Is there a work-around, so that I can force the SOAP request not to include the wrapper ?
    • Can anyone help with this? I'm guessing at this point that this is a limitation that can't be easily worked around ?
  • await error when returning TaskAwaiter<T> from PCL
    5 Posts | Last post November 06, 2012
    • One of my types in my PCL (net4+win8+sl4+wp71) library returns a TaskAwaiter<T> when its GetAwaiter() is called.
      I'm trying to consume this using await in a unit test project (net45), but I get an interesting error:
      'System.Runtime.CompilerServices.TaskAwaiter`1<int>' does not contain a definition for 'IsCompleted'
      I've tried adding an app.config (as a side note, it looks like if you binding-redirect System.Runtime, then VS "loses" all the tests), and referencing MS.Bcl.Async, but the error persists.
    • I can repro this internally. I'm not sure of the cause around this, I've filed a bug and we'll investigate.
    • Okay, I figured this out - the compiler is failing to complain that you need to reference Microsoft.Threading.Tasks.dll. It fails to resolve TaskAwaiter which lives in Microsoft.Threading.Tasks, hence, can't find its IsCompleted property.
      As a workaround, add a manual reference to Microsoft.Threading.Tasks from the package (it doesn't matter to which one) and this will build successfully. Make note, it's not a matter of referencing Microsoft.Bcl.Async from 4.5, because we don't install any binaries for 4.5 projects.
    • Thanks for your help, David!
      Unfortunately, my unit test project also uses Task.Yield, and when I add a reference to Microsoft.Threading.Tasks.dll from MS.Bcl.Async, I get this error:
      The type 'System.Runtime.CompilerServices.YieldAwaitable' exists in both '...\packages\Microsoft.Bcl.Async.1.0.12-beta\lib\portable-net40+sl4+win8+wp71\Microsoft.Threading.Tasks.dll' and 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll'
      I tried to make my own .NET 4.5 Microsoft.Threading.Tasks.dll just doing a type forward of TaskAwaiter<> to mscorlib, but couldn't get that working (it still has the 'IsCompleted' error).
      I'm currently working around this by just defining my own awaiter type instead of using TaskAwaiter<>.
    • Yep, do that for now. We spoke yesterday of a way to avoid this, and we should have a fix in the next update.
1 - 10 of 128 Items