4
votes

I'd like to make a Portable Class Library (PCL) version of a .NET 4.5 library capable of targeting Mono for Android. This library also makes heavy use of async / await.

I understand that the latest Xamarin Preview release includes support for async / await, and it seems that others have async / await working with PCL, but can the combination be made to work? If so, can someone provide the secret formula?

1
Um... Reference the .NET 4.5 framework? Why don't you tell us a little more about the problem you are experiencing. It might make it a little easier for us to help you without donning our psychic debugger hats.Robert Harvey
Last I heard, Xamarin does not yet (officially) support PCLs (though you may be able to hack something together using Microsoft.Bcl.Async). I've looked into PLC+async support on Xamarin over the last week and have concluded it's simply not mature enough yet. Hopefully soon...Stephen Cleary

1 Answers

4
votes

I've got it working using .NET Framework Profile78. 78 appears to be the combination of .NET 4.5, Windows Phone 8, and .NET for Windows Store apps.

The easiest way is to update your .csproj file replace the existing TargetFrameworkVersion and TargetFrameworkProfile tags with these:

<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile78</TargetFrameworkProfile>