Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

VS2017 Xamarin - cannot reference a shared project in the client project

I`ve tried to find something similar to my issue and could not find.

I am starting a new project using VS2017 with all latest updates.

A project of tyep Xamarin Cross-Platform. I get the usual MainProject, AndroidProject, iOSProject, and UWP project.

The MainProject is of type portable library.

Now, the issue is when I try and add to the solution a new project of type portable library I see that it is deprecated and I should use Shared Library. So I add a shared library project and reference it in MainProject. When I build the project I get a message that the shared project version 1.4 cannot be reference by a project of .Net version 4.5

MainProject is set to .Net 4.5 and I am unable to change it to .Net 4.6 as the android project is set to .Net 4.5 which I don`t see where I can change it.

Here is the message I get:

Project [SharedProject] targets '.NETStandard,Version=v1.4'. It cannot be referenced by a project that targets '.NETPortable,Version=v4.5,Profile=Profile259'
I have read that .Net 4.6 can ref shared project of version 1.3 but that doesn`t help me since I cannot change the .Net version to 4.6.

Anyone has any idea how I can ref some library project? (so I can do models, contracts, etc. to be shared)

P.S.

When I try to add a project of type portable library I can`t because the target types are not the same I also cannot change them.

In the past I was able to do that but something has change and I cannot figure out what.

Sign In or Register to comment.