0

I have one PCL project, in this project I made Xunit project, which I want to reference my PCL project to test it.

When I'm trying to add a reference, I cant check it, because of I have an error like this:

Incompatible target framework: .NETPortable,Version=v.4.5,profile=Profile111)

I'm using Visual studio Mac, I've also updated everything from Check Updates Also updated all Nuget packages.

Tornike Gomareli
  • 1,564
  • 2
  • 16
  • 28
  • 1
    Which profile is your PCL targeting? Are they compatible (welp, apparently they are not). Perhaps try retargeting? https://portablelibraryprofiles.stephencleary.com – orhtej2 Nov 13 '17 at 21:29

1 Answers1

0

I am assuming this is a .NET Core xUnit project which is trying to reference the PCL project.

Currently this is prevented in Visual Studio for Mac 7.2 and earlier versions. In Visual Studio for Mac 7.3 and later, currently available on the alpha channel, it is possible to reference a PCL project from a .NET Core project.

For Visual Studio for Mac 7.2 the only workaround would be to add the project reference manually by editing the .csproj in the text editor. For example:

<ItemGroup>
  <ProjectReference Include="..\PclProject\PclProject.csproj" />
</ItemGroup>
Matt Ward
  • 47,057
  • 5
  • 93
  • 94