protobuf-net / protobuf-net

Protocol Buffers library for idiomatic .NET
Other
4.64k stars 1.05k forks source link

Support PCL Profile111 #49

Open jasonall opened 9 years ago

jasonall commented 9 years ago

The current version includes support for the Profile136 PCL version, and it includes support for WinRT. Unfortunately, these leave a gap in a core scenario:

Try to create a portable library which references protobuf-net, which can be included in both a Windows 8.1 project and a Windows Phone 8.1 project. It is currently not possible. This is very painful, as it means that protobufs cannot be used in any shared library consumed by a universal app (an app which contains both a windows 8.1 and a windows phone 8.1 flavor).

As it turns out, the current WinRT flavor of protobuf-net CAN be directly referenced by a Windows 8.1 project, and it CAN be directly referenced by a Windows Phone 8.1 project, but it CANNOT be referenced by any PCL library which can then be referenced by those two project types.

To solve this, please add another PCL flavor (Profile 111). From File->New Project in Visual Studio, choose the PCL class library template, and then select this combination of items:

.Net 4.5 Windows 8.1 Windows Phone 8.1

Unselect everything else.

Hijdra commented 9 years ago

For the time being I solved this by doing the next steps:

  1. Add a Universal Portable Library next to the WinRT library.
  2. Copy every file from the WinRT to the Universal project.
  3. Remove the AssemblyInfo.cs from the Properties folder.
  4. Copy the build Conditional compilation symbols from the WinRT to the Universal library.
  5. Have fun :smiley:

Would be awesome if this is included in Nuget

BrannonKing commented 9 years ago

I would like support for profile 259: [portable-win8+net45+wp8+wpa81]. Thanks.