Skip to content

SDK Binding projects shouldn't have Resource.designer.cs #6198

Description

@jpobst

Using: 6.0.100-preview.7.21379.14

In Legacy binding projects, a Resource.designer.cs file is not created and no Resource class is added to the assembly. In .NET 6, Resource.designer.cs is created and a Resource class is added, even if it's "empty".

I assume this class is not needed as we've never had it before.

This is causing a few issues for AndroidX/GPS:

  • The Resource class is generated in the default namespace, which is the assembly name, which isn't actually used elsewhere and conflicts with a type name. eg: Xamarin.AndroidX.LiveData.Resource and Xamarin.AndroidX.LiveData types.
  • The GPS default namespaces are actually invalid, since they are based on the aar name, resulting in types like com.google.android.gms.play-services-basement.Resource.

While these issues are ultimately fixable, it feels like we don't intend to add the Resource class for binding projects. (Maybe $(OutputType) = 'Library'?)

Repro projects:
Legacy.zip
NET6.zip

Note the projects won't fully build because I didn't do the metadata or dependencies for them, but they get to the csc step, which means the Resource.designer.cs has been generated already.

Activity

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

Metadata

Metadata

Labels

Area: App+Library BuildIssues when building Library projects or Application projects.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions