Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Resource.designer.cs does not yet support comma-delimited list for library %(Aliases) metadata #4409

Closed
brendanzagaeski opened this issue Mar 17, 2020 · 4 comments · Fixed by #4423
Assignees
Labels
Area: App+Library Build Issues when building Library projects or Application projects.

Comments

@brendanzagaeski
Copy link
Contributor

Context: #3808 (comment)

In Visual Studio, I noticed that the description text for Aliases in the Properties window says:

A comma-delimited list of aliases to this reference.

I haven't yet found a mention of this in my quick searches of docs.microsoft.com, but it seems this is indeed allowed for the %(Aliases) metadata.

Steps to reproduce

  1. Edit the AndroidUpdateResourcesTest.CheckProjectReferenceAlias test to replace:

    -Metadata = { { "Aliases", "Lib1" } },
    +Metadata = { { "Aliases", "Lib1A,Lib1B" } },
  2. Run the test.

Expected behavior

The test passes.

It looks like the desired external alias lines to generate for Resource.designer.cs would probably be:

extern alias Lib1A;
extern alias Lib1B;

Actual behavior

The test fails due to a syntax error in the generated Resource.designer.cs:

extern alias Lib1A,Lib1B;
Resources\Resource.designer.cs(1,20,1,21): error CS1002: ; expected

Version information

xamarin-android/master@aaea55ff99ae033682dc8eef0817ddbe007aa542

@brendanzagaeski brendanzagaeski added the Area: App+Library Build Issues when building Library projects or Application projects. label Mar 17, 2020
@brendanzagaeski brendanzagaeski added this to the Under Consideration milestone Mar 17, 2020
dellis1972 added a commit to dellis1972/xamarin-android that referenced this issue Mar 19, 2020
Fixes dotnet#4409

Our inital commit (d18c824) to support Aliases did not take
into account the fact your can add more than one.

This commit handles the comma delimited `Aliases` metadata
so that the generated Resource.designer.cs file compiles.
@dellis1972
Copy link
Contributor

Pr up #4423

jonpryor pushed a commit that referenced this issue Mar 19, 2020
…4423)

Fixes: #4409

Commit d18c824 added support for `%(Aliases)`, but `%(Aliases)` can
contain a comma-separated list of names, accorind go the description
text in the Visual Studio **Properties** window:

> A comma-delimited list of aliases to this reference.

However, if you attempt to actually provide a comma-separated list of
values, a CS1002 will instead be reported:

	Resources\Resource.designer.cs(1,20,1,21): error CS1002: ; expected

because we generate the line:

	extern alias Lib1A,Lib1B;

Add support for comma delimited `%(Aliases)` metadata values so that
the generated `Resource.designer.cs` file compiles, emitting a=
separate `extern alias` per value:

	extern alias Lib1A;
	extern alias Lib1B;
jonpryor pushed a commit that referenced this issue Mar 23, 2020
…4423)

Fixes: #4409

Commit d18c824 added support for `%(Aliases)`, but `%(Aliases)` can
contain a comma-separated list of names, accorind go the description
text in the Visual Studio **Properties** window:

> A comma-delimited list of aliases to this reference.

However, if you attempt to actually provide a comma-separated list of
values, a CS1002 will instead be reported:

	Resources\Resource.designer.cs(1,20,1,21): error CS1002: ; expected

because we generate the line:

	extern alias Lib1A,Lib1B;

Add support for comma delimited `%(Aliases)` metadata values so that
the generated `Resource.designer.cs` file compiles, emitting a=
separate `extern alias` per value:

	extern alias Lib1A;
	extern alias Lib1B;
@brendanzagaeski
Copy link
Contributor Author

Release status update

A Preview version has now been published on Windows that includes the fix for this item. The fix is not yet included in a Release version. This item will be updated again when a Release version is available that includes the fix.

The fix is not yet available on macOS. I will update this item again when a Preview version with the fix is available on macOS.

Fix included in Xamarin.Android 10.3.0.74

Fix included on Windows in Visual Studio 2019 version 16.6 Preview 3. To try the Preview version that includes the fix, check for the latest updates in Visual Studio Preview.

Fix not yet available on macOS.

@brendanzagaeski
Copy link
Contributor Author

Release status update

A Preview version of Xamarin.Android has now been published on macOS that includes the fix for this item. The fix is not yet included in a Release version. I will update this item again when a Release version is available that includes the fix.

Fix included in Xamarin.Android 10.3.0.74.

Fix included on macOS in Visual Studio 2019 for Mac version 8.6 Preview 2. To try the Preview version that includes the fix, check for the latest updates on the Preview updater channel.

@brendanzagaeski
Copy link
Contributor Author

Release status update

A new Release version has now been published that includes the fix for this item.

Fix included in Xamarin.Android 10.3.1.0.

Fix included on Windows in Visual Studio 2019 version 16.6. To get the new version that includes the fix, check for the latest updates or install the latest version from https://visualstudio.microsoft.com/downloads/.

Fix included on macOS in Visual Studio 2019 for Mac version 8.6. To get the new version that includes the fix, check for the latest updates on the Stable updater channel.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Area: App+Library Build Issues when building Library projects or Application projects.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants