-
Notifications
You must be signed in to change notification settings - Fork 802
Closed as not planned
Closed as not planned
Copy link
Labels
area/code-generationCategorizes an issue or PR as relevant to code generationCategorizes an issue or PR as relevant to code generationdifficulty/medium 🤔Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUICategorizes an issue for which the difficulty level is reachable with a good understanding of WinUIkind/enhancementNew feature or requestNew feature or requeststaleThis item has been marked as stale and will be closed if there is no activity.This item has been marked as stale and will be closed if there is no activity.triage/potentially-fixedCategorizes an issue as potentially fixed by some unlinked PR, fix needs to be verifiedCategorizes an issue as potentially fixed by some unlinked PR, fix needs to be verified
Description
One or more of the following lines are throwing System.Exception
at a location where exceptions are not expected:
uno/src/SourceGenerators/Uno.UI.SourceGenerators/DependencyObject/DependencyPropertyGenerator.cs
Lines 48 to 53 in 574a441
_dependencyObjectSymbol = comp.GetTypeByMetadataName(XamlConstants.Types.DependencyObject) | |
?? throw new Exception("Unable to find " + XamlConstants.Types.DependencyObject); | |
_generatedDependencyPropertyAttributeSymbol = comp.GetTypeByMetadataName("Uno.UI.Xaml.GeneratedDependencyPropertyAttribute") | |
?? throw new Exception("Unable to find Uno.UI.Xaml.GeneratedDependencyPropertyAttribute"); | |
_dependencyPropertyChangedEventArgsSymbol = comp.GetTypeByMetadataName("Windows.UI.Xaml.DependencyPropertyChangedEventArgs") | |
?? throw new Exception("Unable to find Windows.UI.Xaml.DependencyPropertyChangedEventArgs"); |
This was identified in error telemetry at Microsoft, and I'm happy to take the time to provide additional details here because you've chosen to make your project open source. 👍
I recommend resolving this issue in one of the following ways:
- If this issue only occurs when there are other compiler errors present in the user code, it would be acceptable to silently disable the source generator in this case. The source generator would become active again when the user corrects the code.
- If this issue can occur where users might not know how to resolve the issue, rather than throw an exception the generator can use the
ReportDiagnostic
API to report a user-visible error specific to the scenario.
Metadata
Metadata
Assignees
Labels
area/code-generationCategorizes an issue or PR as relevant to code generationCategorizes an issue or PR as relevant to code generationdifficulty/medium 🤔Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUICategorizes an issue for which the difficulty level is reachable with a good understanding of WinUIkind/enhancementNew feature or requestNew feature or requeststaleThis item has been marked as stale and will be closed if there is no activity.This item has been marked as stale and will be closed if there is no activity.triage/potentially-fixedCategorizes an issue as potentially fixed by some unlinked PR, fix needs to be verifiedCategorizes an issue as potentially fixed by some unlinked PR, fix needs to be verified