dotnet / Microsoft.Maui.Graphics.Controls

Experimental Microsoft.Maui.Graphics.Controls - Build drawn controls (Cupertino, Fluent and Material)
MIT License
647 stars 61 forks source link

Can't compile a Windows app using this library #105

Open ScottArbeit opened 2 years ago

ScottArbeit commented 2 years ago

Hi! Quick question: I'm trying this library for the first time, and I use Windows, so I was hoping to just compile a Windows app to look at things. When I select Windows in the platform drop-down, I get errors, as shown:

image image

Repro:

  1. Open VS2022 (using Version 17.1.0 Preview 4.0, with MAUI Preview 12)
  2. Create new .NET MAUI project
  3. Add Microsoft.Maui.Graphics.Controls NuGet package from nightly feed
  4. Add using statements and call to .ConfigureGraphicsControls()
  5. Select Windows from the platform drop-down menu
  6. Get errors when trying to compile to Windows

Is this expected right now? I understand that this is experimental, so, if Windows just isn't implemented yet, that's fine. Just want to make sure I'm not being an idiot...

dev-thinks commented 2 years ago

yes. not compiling with windows. bump when try adding it from nightly build.

tobiasbaur commented 2 years ago

It worked with 250, but not 253 on Windows in preview 12.

In a related topic, the library seems to be not working in maui (Windows) preview 13. Can anybody confirm this? And is a fix planned?

When calling

var builder = MauiApp.CreateBuilder(); builder .UseMauiApp<App>() .ConfigureGraphicsControls(DrawableType.Material); The Exception

System.MissingFieldException: "Field not found: 'Microsoft.Maui.Graphics.Win2D.W2DGraphicsService.Instance'."

is thrown. If I comment it out, the code works, but elements are not drawn.

EthanHipps commented 2 years ago

@tobiasbaur I encountered a similar error today when I tried adding the library to my project. Preview 13 too, but building for Android instead of Windows. If I comment out .ConfigureGraphicsControls(DrawableType.Material) the project builds and works without issue.

image

The Exception:

Could not resolve type with token 010000b2 from typeref (expected class 'Microsoft.Maui.Graphics.Native.NativeGraphicsService' in assembly 'Microsoft.Maui.Graphics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null')

jsuarezruiz commented 2 years ago

This issues with Preview 13 will be fixed with https://github.com/dotnet/Microsoft.Maui.Graphics.Controls/pull/106 (in progress)

aliessmael commented 2 years ago

Not compiling, I am using this GitHub code ( not able to find NuGet package ) and I have Visual studio 17.3.0 Preview 2.0, Windows 10 Pro

KMRH47 commented 2 years ago

Also broken here running VS 2022 Version 17.3.0 Preview 3.0

MattBDev commented 1 year ago

Will this be fixed anytime soon or is the plan to abandon this library and merge it into .NET MAUI?

WongResearch commented 1 year ago

This issues with Preview 13 will be fixed with #106 (in progress)

Hopefully #106 will make it to the nightly build soon.

For those using the latest nightly build (294) and must target windows you can try excluding it for now for it to compile for ios and android:

2022-10-13 at 17 09 02

2022-10-13 at 17 09 38

juliusdeblaaij commented 10 months ago

Is there any progress on this front?

mgramley commented 10 months ago

Any update on this bug? I still can't get this library to work with windows