Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SkiaSharp.Views.Mac namespace does not exist #736

Open
Andrejf opened this issue Dec 17, 2018 · 2 comments
Open

SkiaSharp.Views.Mac namespace does not exist #736

Andrejf opened this issue Dec 17, 2018 · 2 comments

Comments

@Andrejf
Copy link

Andrejf commented Dec 17, 2018

Description

If I create a fresh Cocoa project in Visual studio Mac and add SkiaSharp and SkiaSharp.View, everything works ok. By default mac apps are set to "Xamarin.Mac Modern" framework.

screenshot 2018-12-17 at 19 50 17

But when I edit the project, General, and change "target framework" to "Xamarin.Mac Full", then it can't find namespace.
SkiaSharp.Views.Mac

screenshot 2018-12-17 at 19 40 44

Is there something I can do to get this working?

Code

// can't find namespace SkiaSharp.Views.Mac;
using SkiaSharp.Views.Mac;

Expected Behavior

It should find the namespace SkiaSharp.Views.Mac

The issue still happens even if I re-add the nuget package.

Actual Behavior

It doesn't find SkiaSharp.Views.Mac.

Basic Information

  • Version with issue: v1.68
  • Last known good version:
  • IDE: Visual Studio for Mac
  • Platform Target Frameworks: Xamarin.Mac Full
  • macOS: 10.14

Screenshots

Reproduction Link

VS bug #753282

@mattleibow
Copy link
Contributor

mattleibow commented Dec 18, 2018

The reason this bug shows is that when you select the full framework option, the app actually "transitions" from a "mac app" to a ".net framework app" and NuGet does not know that this particular app is actually both a "mac app" AND a "framework app".

A workaround would be to do one of two things:

  • use packages.config and then change the HintPath to the Xamarin.Mac version
  • don't reference the SkiaSharp.Views package, and manually add a reference to SkiaSharp.Views.Mac.dll

There has been an issue that has been opened, closed, reopened and eventually locked with a few PRs. But, not to be outdone, I have created a new PR that hopefully gets this in: NuGet/NuGet.Client#2572

This is not the greatest situation right now, but hopefully after this is merged, we can all be happy coders!

@mattleibow
Copy link
Contributor

mattleibow commented Jun 24, 2019

I have not had the opportunity to test this, but it seems we have a new option to turn macOS apps into real macOS apps: NuGet/NuGet.Client#2572 (comment)

Basically, you can add <MigrateToNewXMIdentifier>true</MigrateToNewXMIdentifier> in your project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants