2
votes

I have a xamarin forms PCL solution and now I want to add xamarin forms pcl class libraries but I am unable to add these libraries as references to my original PCL project seeing. It gives me the following error:

Unable to add reference to project. The targets of Portable Library project are not the same or compatible with the targets of the current Portable Library project.

I have tried to change the targets on the PCL projects so that they match up but I can't do it in Visual Studio 2017.

Below are the targets for the original PCL project. image

Below are the targets for the project I want to reference in the original PCL project. image

Can anyone please assist or advice on how to accomplish this?

1
From Solution Explorer -> Right click on the PCL project -> Unload Project -> right click on the project -> Edit xxx.csproj and change the target in <TargetFrameworkProfile>Profile111</TargetFrameworkProfile>. Save your changes and then Reload the project.user2297037
Thanks user2297037 that worked for me. Lets hope everything else will work just as easily. Can you add your answer to the post so that I can mark it as the solution?GANDA1F

1 Answers

0
votes

I found the solution to my problem. Its a slight change to @user2297037's answer. I did have to change the profile in the project file. The initial Portable Class Library's profile was Profile259 and the two new Portable Class Libraries' was Profile111. Changing the initial Portable Class Library's profile seemed to work but created massive problems at build time. I then reverted the change to the initial Portable Class Library and then changed the Profile on the two new Portable Class Libraries from Profile111 to Profile259. This solved my problem.