Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reference VS 2012 portable class library from unit test?

I created a portable C# class library in VS 2012 from sources of on older project, but if I try to add a reference to the new library in a unit test library targeting .NET 4.0, it says:

Unable to add a reference to project '(portable project name)'. The current project's target framework is not one of or compatible with the target frameworks of Portable Library project '(portable project name)'.

How do I test the portable library?

Thanks.

-John

like image 388
jtsoftware Avatar asked Feb 01 '13 03:02

jtsoftware


Video Answer


1 Answers

Usually this happens when the portable library selected profile does not match the target platform chosen for a project that references it. What are the platforms that you are targeting from your PCL? Note that if you target .NET 4.0.3 and not .NET 4 then it can be referenced from a project that targets .NET 4.0.

like image 81
Vagif Abilov Avatar answered Nov 14 '22 23:11

Vagif Abilov