Mark Erickson
Mark Erickson

Reputation: 797

Using latest Xamarin Studio, build errors stating "Can't find .NetPortable" framework

I'm using the latest Xamarin Studio and have even tried the alpha channel and I'm still getting the same issue.

/Library/Frameworks/Mono.framework/Versions/3.2.0/lib/mono/4.0/Microsoft.Common.targets: Warning: Unable to find framework corresponding to the target framework moniker '.NETPortable,Version=v4.0,Profile=Profile3'. Framework assembly references will be resolved from the GAC, which might not be the intended behavior.

This is happening with creating just an empty PCL project. I'm not seeing any posts which lead me to any answer. I am targeting Mono 3.2 and I have tried several profile numbers.

Any ideas?

Upvotes: 5

Views: 5169

Answers (2)

woody121
woody121

Reputation: 358

My issue was related but different - opening an existing project made by another developer required me to manually select the correct profile.

Click on the specific project (not the solution) and select the gear icon (in the file tree). Selection Options > Build and pick a different profile.

It may be related to requiring you to purchase more capability in Xamarin as well, I should add.

Upvotes: 0

jbtule
jbtule

Reputation: 31799

Since the profile your are targeting is Profile 3 (.net 4.0 and Silverlight4) the only way and older version would work if it's prior to Portable support in mono and faked it (I believe that would be some version prior to 3.0.12 and faking it may not be what you want, you may want to change your target).

Mono 3.1.2 was the first version that could out of the box compile PCL libraries, because it was distributed with facaded assemblies in

/Library/Frameworks/Mono.framework/Versions/3.1.2/lib/mono/xbuild-frameworks/.NETPortable

for:

  • v4.0, Profile136 .NET Framework 4, Silverlight 5, Windows Phone 8, Windows Store apps (Windows 8)
  • v4.0, Profile14 .NET Framework 4, Silverlight 5
  • v4.0, Profile147 .NET Framework 4.0.3, Silverlight 5, Windows Phone 8, Windows Store apps (Windows 8)
  • v4.0, Profile158 .NET Framework 4.5, Silverlight 5, Windows Phone 8, Windows Store apps (Windows 8)
  • v4.0, Profile19 .NET Framework 4.0.3, Silverlight 5
  • v4.0, Profile24 .NET Framework 4.5, Silverlight 5
  • v4.0, Profile37 .NET Framework 4, Silverlight 5, Windows Store apps (Windows 8)
  • v4.0, Profile42 .NET Framework 4.0.3, Silverlight 5, Windows Store apps (Windows 8)
  • v4.0, Profile47 .NET Framework 4.5, Silverlight 5, Windows Store apps (Windows 8)
  • v4.0, Profile5 .NET Framework 4, Windows Store apps (Windows 8)
  • v4.0, Profile6 .NET Framework 4.0.3, Windows Store apps (Windows 8)
  • v4.5, Profile49 .NET Framework 4.5, Windows Phone 8
  • v4.5, Profile7 .NET Framework 4.5, Windows Store apps (Windows 8)
  • v4.5, Profile78 .NET Framework 4.5, Windows Phone 8, Windows Store apps (Windows 8)

Mono 3.2.0 currently has none.

Upvotes: 4

Related Questions