smourier / DirectN

Direct interop Code for .NET Framework, .NET Core and .NET 5+ : DXGI, WIC, DirectX 9 to 12, Direct2D, Direct Write, Direct Composition, Media Foundation, WASAPI, CodecAPI, GDI, Spatial Audio, DVD, Windows Media Player, UWP DXInterop, WinUI3, etc.
MIT License
311 stars 28 forks source link

error when create uwp app release package #14

Closed iloxmn closed 2 years ago

iloxmn commented 2 years ago

InvalidCSharpIdentifierName

Severity Code Description Project File Line Suppression State Error MCG0037: MCG0037:InvalidCSharpIdentifierName Struct 'DirectN.HRESULT' in assembly 'Assembly(Name=DirectN, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, Location=*\obj\x64\Release\ilc\in\DirectN.dll)' has a field with name 'k__BackingField' that is invalid. This could be because the name is obfuscated or the field is auto-implemented by the compiler. Please make sure the field name follows C# identifier conventions.

it's working in debug mode, but not release also I can't find a method to dispose items created, how can I destroy them from memory

smourier commented 2 years ago

This is an issue only with .NET Native toolchain, specific to UWP, like here https://github.com/microsoft/dotnet/issues/807 because DirectN source code uses auto properties with is standard C# code.

.NET Native has lots of issues, I won't change DirectN because of this, as it isn't meant for UWP but for regular .NET projects. Still, DirectN is open source, so you can pick only the files you need and tweak them the way you want.

As for Dispose, it depends, some objects have, some don't, by design. Not sure what you are talking about.

iloxmn commented 2 years ago

Ok, but I can't find anything related to backingfield, so what do I need to do to make it work.

Win2d provide a method to dispose font face, but I can't find it on other directwrite wrapper https://microsoft.github.io/Win2D/WinUI2/html/M_Microsoft_Graphics_Canvas_Text_CanvasFontFace_Dispose.htm

smourier commented 2 years ago

Don't use .NET native toolchain

pjmlp commented 2 years ago

@iloxmn Win2D is mostly written in C++.

smourier commented 2 years ago

closed due to inactivity