Do Portable Class Libraries work with .net 3.5?
Asked Answered
N

3

6

I am running Windows 8 and have both Visual Studio 2010 Ultimate w/sp1 and Visual Studio 2012 Ultimate and I am trying to create a Portable Class Library that supports .net 3.5 and greater.

When I first try to create a PCL I get a screen like this:PCL selection screen

I noticed that .net 3.5 is not in the list so I clicked on "Install additional frameworks" and found a Targeting Pack for version 3.5. But when I download and run "dotnetfx35setup.exe" nothing happens. And when I go back into VS and try to create a new Portable Class Library, it lists the same target frameworks as before.

I have also turned on the Windows Features for .NET Framework 3.5 and am now out of ideas. Here is a screen shot in case I missed something else.

Windows Features

Thanks,

Nepean answered 24/10, 2012 at 14:19 Comment(3)
.NET Framework 3.5 didn't have a portable profile. Do you have this problem within Visual Studio 2010? I noticed once I installed Visual Studio 2012 on my own computer, the .NET Framework 3.5 was actually removed, likely because .NET 4.5 contains it.Ceram
That maybe true but why do they list the .net 3.5 Targeting Pack? Also I have vs2012 and vs2010 on two different machines.Nepean
No, PCL requires .NET 4 and up.Lepore
C
5

.NET Framework 3.5 didn't have a portable profile. Do you have this problem within Visual Studio 2010? I noticed once I installed Visual Studio 2012 on my own computer, the .NET Framework 3.5 was actually removed, likely because .NET 4.5 contains it.

Because you can still target to the .NET 3.5 if you want, just not a portable profile ( PCL ), which is easily proven by this article what you want is simply not supported.

Ceram answered 24/10, 2012 at 14:48 Comment(0)
V
0

As has been called out by others, .NET Framework 3.5 is not supported by portable library.

The link at the bottom of the page is a general landing page that lists all the targeting packs for all of our frameworks, not just the ones that work with portable, sorry for the confusion.

Viol answered 30/10, 2012 at 20:48 Comment(0)
V
0

Visual Studio (either 2010 or 2012) allowed me to reference a simple Portable Class Library of Plain Old CLR Objects (POCOs) in another Class Library targeting .NET 3.5. This project works with Visual Studio 2015 as well.

It's possible that using some .NET 4.5 features in your PCL won't prevent it from compiling, but will make it incompatible for referencing from .NET 3.5.

Vern answered 28/3, 2018 at 22:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.