Great addition that was desperately needed for multi-platform. It's not perfect yet, but is a great stride forward to delivering a cross-platform runtime. Please keep adding namespaces such as the new ones introduced in .NET 4 and 4.5. Thank you!
It is great tool, but as the other said, please add the namespace System.XML.Linq and System.ComponentModel.DataAnnotations.dll since they are available in new .net framework. http://support.microsoft.com/kb/2600211
This is an extremely useful tool. It has helped me a lot when designing data models for projects where the target platforms have not yet been finalized and where leaving open the option to add additional platforms in the future is desirable.
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.
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.
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.
I'm interested in adding portable library support to NuGet.
This means NuGet.exe will need to map from the .NETPortable profile names to the supported FrameworkNames. The information is right there in xml under Reference Assemblies, so the easiest way to do this is to just copy those xml files into the output directory.
Are there any MSBuild properties that I could easily use for this?
Yes do have support for the full set in VS11 (when targeting platforms that support them), and we're about to release an update to the VS2010 which will also include the fullset.
There are no current plans to support it on vanilla .NET 4.0. We simply cannot make it possible, these types lives in different assemblies between Silverlight and Phone and there's not a way to make them seen as equivalent without runtime changes. We're considering our options for enabling in later platform updates to 4.0.
Hi, I am building an OSS library that depends on System.Xml.Linq. With the new bits I can now build this library in VS2010 with .net 4.0.3 as a target. That's great, thanks!
I am now wondering how this lib could be used from VS2010. When it is added as an assembly reference to a .net 4.0 project there is no error or warning. Could I expect it to work properly like that?
If I add this lib as a project reference the dependent project needs to be 4.0.3 or higher. This is not supported by default in VS2012. You need to install a new design time update: http://www.microsoft.com/en-us/download/details.aspx?id=29054. Are there ways to make this easier? Could the design time update for 4.0.3 perhaps be part of the PLT update?
Thanks,
Paul
This code:
protected bool ContainsExcludeFromSerializationAttribute(PropertyInfo property)
{
foreach (Type attrType in AttributesToIgnore)
{
object[] attributes = property.GetCustomAttributes(attrType, false);
causes this exception with the PCL in WinRT C#:
Could not load file or assembly 'System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. Failed to add file to AppDomain cache. (Exception from HRESULT: 0x80131052)
How can I fix that?
...Stefan
Hi,
I'm trying to migrate business logic from a prototype written in Silverlight 5 to a VS 2010 portable library project. One problem I'm running into is that generic covariance doesn't seem to work in the portable library.
In SL5, I can have an interface IFoo with an Items property of type IEnumerable<Base>. Then I can have a class Foo implementing IFoo, with an Items property returning IEnumerable<Derived>. This doesn't seem to work in the portable library.
I am guessing this is because the portable library targets Silverlight 4, and SL4 did not support generic variance. Does the VS 2011 beta version of portable libraries solve this problem? Or is there a solution for VS 2010?
Thanks for your help,
Richard
Is there a reason System.Environment.OSVersion is not included in the PCL? It would greatly help with writing code that targets different platforms at run-time (for example different behavior on devices with less memory).
Or is there another way/hack to determine the platform at runtime?
There is no System.Threading.Timer class in Metro style applications framework. But it could be used in portable libraries even if they are targeted to Metro style applications. This could lead to compile or run -time errors.
Used VS2011 Beta.
Thanks, this is actually by-design. We don't expose Timer in Metro style apps in lieu of the WinRT equivalent, however, it is supported and will work at runtime. It is known that an API that exposes Timer publically in portable will not be consumable from Metro, however, we felt the benefits of having it, outweighed the benefits of not having it.
It appears that the GUI in VS 11 allows you to add references to a PCL that it probably shouldn't. I created a test PCL that targets .NET and Metro then I added references to PresentationCore and PresentationFramework. These were available under the "Recent" tab of the Reference Manager dialog. I even referenced the CommandManager type in the PCL and compiled. There were no errors, warnings, or warning icons displayed in the Errors window, the Reference Manager dialog, or under the References icon in Solution Explorer.