Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[X] Accept RD.Source with assembly #13484

Merged
merged 1 commit into from
Jan 22, 2021
Merged

[X] Accept RD.Source with assembly #13484

merged 1 commit into from
Jan 22, 2021

Conversation

StephaneDelcroix
Copy link
Member

@StephaneDelcroix StephaneDelcroix commented Jan 21, 2021

Description of Change

[X] Accept RD.Source with assembly
this also always add the assembly part in the Source url

Issues Resolved

API Changes

None

Platforms Affected

  • Core/XAML (all platforms)
  • iOS
  • Android
  • UWP

Behavioral/Visual Changes

None

Before/After Screenshots

Not applicable

Testing Procedure

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)

this also always add the assembly part in the Source url

- fixes #13187
- fixes #2660
asmName = parts[1];
if (currentModule.Assembly.Name.Name != asmName)
{
var ar = currentModule.AssemblyReferences.FirstOrDefault(ar => ar.Name == asmName);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we check if the assembly exists ? And throw a more meaningful error if it doesn't , let's say i set something like:

SharedResourceDictionary.xaml;assembly=FooWithANNamingError",

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you get ResourceMissing. We could have a specialised message, but not in a -sr (as it involves translation)

Copy link

@Tommigun1980 Tommigun1980 Jan 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to add a comment here but must have missed to submit it.

Wouldn't it be safer to split the string on ';' and parse the left and right parts independently? The code right now assumes that 'assembly=xxx;' is the last parameter. It will also crash if 'assembly=' is used, which to the best of my knowledge is valid and should just be ignored. So a future-proof parsing would be to just split on ';'.

@PureWeen PureWeen merged commit af2c1b0 into 5.0.0 Jan 22, 2021
@PureWeen PureWeen deleted the fix_gh13187 branch January 22, 2021 20:24
@samhouts samhouts added this to the 5.0.0 milestone Jan 25, 2021
@samhouts samhouts added partner Issue submitted by partner or related open source project proposal-open t/enhancement ➕ a/resources blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. hotreload Forms bugs that affect Hot Reload t/bug 🐛 labels Feb 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/CSS a/resources a/Xaml </> blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. hotreload Forms bugs that affect Hot Reload partner Issue submitted by partner or related open source project proposal-open t/bug 🐛 t/enhancement ➕
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] ResourceDictionary.Source does not include assembly name Cross Assembly CSS Portability
6 participants