Microsoft.Maui.Graphics.Controls icon indicating copy to clipboard operation
Microsoft.Maui.Graphics.Controls copied to clipboard

Can't compile a Windows app using this library

Open ScottArbeit opened this issue 2 years ago • 10 comments

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...

ScottArbeit avatar Jan 30 '22 20:01 ScottArbeit

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

dev-thinks avatar Feb 07 '22 03:02 dev-thinks

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.

tobiasbaur avatar Feb 17 '22 15:02 tobiasbaur

@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')

EthanHipps avatar Feb 25 '22 17:02 EthanHipps

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

jsuarezruiz avatar Feb 27 '22 12:02 jsuarezruiz

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

aliessmael avatar Jul 09 '22 14:07 aliessmael

Also broken here running VS 2022 Version 17.3.0 Preview 3.0

KMRH47 avatar Jul 18 '22 20:07 KMRH47

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

MattBDev avatar Aug 04 '22 17:08 MattBDev

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

WongResearch avatar Oct 13 '22 07:10 WongResearch

Is there any progress on this front?

juliusdeblaaij avatar Aug 26 '23 20:08 juliusdeblaaij

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

mgramley avatar Sep 08 '23 01:09 mgramley