Questions tagged [portable-class-library]

The Portable Class Library project enables you to write and build managed assemblies that work on more than one .NET Framework platform (Silverlight, WP7, or XNA).

Using the Portable Class Library project, you can build portable assemblies that work without modification on the .NET Framework, Silverlight, Windows Phone 7, or XNA (Xbox) platforms. Without the Portable Class Library project, you must target a single platform and then manually rework the class library for other platforms. The Portable Class Library project supports a subset of assemblies from these platforms, and provides a Visual Studio template that makes it possible to build assemblies that run without modification on these platforms.

More Detail on What is Portable Class Library?

1414 questions
234
votes
19 answers

Build error: You must add a reference to System.Runtime

I'm preparing a brand new ASP.NET MVC 5.1 solution. I'm adding in a bunch of NuGet packages and setting it up with Zurb Foundation, etc. As part of that, I've added a reference to an in-house NuGet package which is a Portable Class Library and I…
Luke Puplett
  • 42,091
  • 47
  • 181
  • 266
112
votes
4 answers

What is a Portable Class Library?

On MSDN I noticed a section about a Portable Class Library, under Version Information. See System.Object for an example. http://msdn.microsoft.com/en-us/library/system.object.aspx I did a brief Google search and couldn't find anything about the…
mjcopple
  • 1,580
  • 2
  • 13
  • 19
65
votes
8 answers

Xamarin Forms: StackLayout with rounded corners

I am developing an app using Xamarin Forms PCL. I need a StackLayout with rounded corners. I have tried frame as well for rounded corner container but there is no corner radius property available for it. I cannot find renderers for…
Sonali
  • 2,223
  • 6
  • 32
  • 69
51
votes
3 answers

Difference between .Net Core, Portable, Standard, Compact, UWP, and PCL?

I've heard of .Net Core .Net Portable .Net Standard .Net Compact Universal Windows Platform Portable Class Libraries All of these were explained to me as "a subset of the full .Net that allows you to target multiple platforms". So my questions…
BlueRaja - Danny Pflughoeft
  • 84,206
  • 33
  • 197
  • 283
50
votes
4 answers

How to send DELETE with JSON to the REST API using HttpClient

I have to send a delete command to a REST API service with JSON content using the HttpClient class and can't make this working. API call: DELETE /xxx/current { "authentication_token": "" } because I can't add any content into below…
Tomasz Kowalczyk
  • 1,873
  • 2
  • 23
  • 33
50
votes
2 answers

Modify request headers per request C# HttpClient PCL

I'm currently using the System.Net.Http.HttpClient for cross platform support. I read that it is not a good practice to instantiate a HttpClient object for each request and that you should reuse it whenever possible. Now I have a problem while…
coalmee
  • 1,334
  • 2
  • 16
  • 27
43
votes
3 answers

Portable class library: recommended replacement for [Serializable]

I am porting a .NET Framework C# class library to a Portable Class Library. One recurring problem is how to deal with classes decorated with the [Serializable] attribute, since this attribute is not part of the Portable Class Library subset.…
41
votes
1 answer

Can I build an "old school" PCL with DNX/DNU?

In Noda Time 1.3.1, our .csproj file referred to Profile 328 and our .nuspec file put the results in lib\portable-net4+sl5+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1+XamariniOS1 For Noda Time 2.0, I've moved everything over to DNX/DNU (soon to be…
Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
40
votes
1 answer

Portable Class Library in MVC 4 / Razor with Visual Studio 2012 RC?

since working with Visual Studio 2012 RC we get an HttpCompileException when using a class out of an portable class library (.net 4.5 & metro profile) within a razor view. Exception: (german to english translated on google,…
BPeter
  • 813
  • 1
  • 8
  • 8
39
votes
2 answers

Convert async lambda expression to delegate type System.Func?

I have an async method inside a portable class library with this signature: private async Task _Fetch(Uri uri) It fetches a resource that is cast back as a concrete type T. I'm working with a 3rd party cache library (Akavache) that requires a…
Craig Presti - MSFT
  • 1,135
  • 1
  • 12
  • 20
38
votes
2 answers

Can I get a "sometimes portable" class library project to load in Visual Studio Express?

For Noda Time version 1.1, the main goal is to build a Portable Class Library flavour, primarily to support Windows Phone and Windows Store apps. This means losing some functionality, so we build a desktop configuration and a PCL configuration (for…
Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
34
votes
2 answers

Create a delegate when there is a conditional attribute

I have a Portable Class Library with a class PCLDebug: public static class PCLDebug { public static Action LogLine { get; set; } } What I want to do is set things up once in the outer project, then be able to call LogLine within the PCL…
William Jockusch
  • 26,513
  • 49
  • 182
  • 323
33
votes
6 answers

Timer in Portable Library

I can't find a timer in portable library / Windows Store. (Targeting .net 4.5 and Windows Store aka Metro) Does any have an idea on how to created some kind of timing event? I need somekind of a stopwatch, so this should refreshn once a second or so
Boas Enkler
  • 12,264
  • 16
  • 69
  • 143
31
votes
8 answers

.Net 2015 References with yellow triangle for Nuget packages on portable libraries

I know the question has been asked before but none of the suggested resolutions are working for me so I'm going to ask it again and hopefully get new suggestions. Some of the articles I've read: VS .Net References with yellow triangle Why do I get a…
Thierry
  • 6,142
  • 13
  • 66
  • 117
29
votes
5 answers

How do you create a unit test assembly for a .NET Portable Class Library?

I am attempting to unit test a Portable Class Library that I've created and I want to make sure it's being tested with the same framework subset that it targets. Per the Visual Studio ALM + Team Foundation Server blog, the MSTest unit test framework…
Travis Illig
  • 23,195
  • 2
  • 62
  • 85
1
2 3
94 95