Skip to content

Workaround for UWP .Net native build#210

Closed
danielcaceresm wants to merge 1 commit into
SharpGenTools:masterfrom
danielcaceresm:fixUWPnative
Closed

Workaround for UWP .Net native build#210
danielcaceresm wants to merge 1 commit into
SharpGenTools:masterfrom
danielcaceresm:fixUWPnative

Conversation

@danielcaceresm

Copy link
Copy Markdown

Build a project that references Vortice using UWP .Net Native throws the following exception:

Microsoft.NetNative.targets(801,5): error : MCG0037: MCG0037:InvalidCSharpIdentifierName Struct 'SharpGen.Runtime.Result' in assembly 'Assembly(Name=SharpGen.Runtime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=a7c0d43f556c6402)' has a field with name '<Code>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.

This issue has been reported 3 years ago, but the only solution is to avoid the use of auto-properties....

You can reproduce the issue creating a new UWP project, adding the SharpGen.Runtime and adding the following line in the MainPage.xaml.cs:

Marshal.SizeOf<Result>();

@danielcaceresm danielcaceresm changed the title Workaround for UWP .Net native Workaround for UWP .Net native build Sep 15, 2021
@amerkoleci

Copy link
Copy Markdown
Contributor

@andrew-boyarshin can we get this PR merged for next release please?

@andrew-boyarshin andrew-boyarshin self-assigned this Sep 15, 2021
@amerkoleci

Copy link
Copy Markdown
Contributor

@andrew-boyarshin any ETA of when this PR wil get merged and new nuget will be released? This is blocker for wave engine guys using vortice windows

@andrew-boyarshin

Copy link
Copy Markdown
Contributor

Thanks @danielcaceresm for pointing this out! I've merged a change similar to yours, but also I've gone through all other structs and checked there are no more autoproperties defined on them. Of course, you're welcome to open an issue if you spot any other .NET Native issues.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants