Microsoft.Maui.Graphics.Controls
Microsoft.Maui.Graphics.Controls copied to clipboard
Can't compile a Windows app using this library
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:


Repro:
- Open VS2022 (using Version 17.1.0 Preview 4.0, with MAUI Preview 12)
- Create new .NET MAUI project
- Add
Microsoft.Maui.Graphics.Controls
NuGet package from nightly feed - Add
using
statements and call to.ConfigureGraphicsControls()
- Select Windows from the platform drop-down menu
- 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...
yes. not compiling with windows. bump when try adding it from nightly build.
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 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.
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')
This issues with Preview 13 will be fixed with https://github.com/dotnet/Microsoft.Maui.Graphics.Controls/pull/106 (in progress)
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
Also broken here running VS 2022 Version 17.3.0 Preview 3.0
Will this be fixed anytime soon or is the plan to abandon this library and merge it into .NET MAUI?
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:
Is there any progress on this front?
Any update on this bug? I still can't get this library to work with windows