-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix handling of wildcard AssemblyVersion properties during markup compilation #2691
Conversation
…a wildcard string is detected in AssemblyVersion.
Maybe we should fix the line break. |
I think we need to sweep the repo and set some attributes to ensure we're all using the same line endings. I don't want to make single changes in this PR, for now I'll keep this as is and we'll make a choice and fixup the repo. EDIT: The renormalization would be a bigger PR, so just going to fix this one file for now. |
...Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/MarkupCompiler/MarkupCompiler.cs
Outdated
Show resolved
Hide resolved
...Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/MarkupCompiler/MarkupCompiler.cs
Outdated
Show resolved
Hide resolved
… on the AssemblyVersion. This allows for the error to be thrown once per MarkupCompile pass and won't present itself as an error at some point in the XAML, but rather as a general error with the AssemblyVersion.
...Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/MarkupCompiler/MarkupCompiler.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/XamlParser.cs
Outdated
Show resolved
Hide resolved
Moving this from WIP to actual, I think it's working pretty well right now. |
I've checked the following scenarios:
Everything works as expected. The error is shown on a bad AssemblyVersion (assuming XAML compilation occurs). Without the fix, wildcard applications using AssemblyVersion crash as in the report. With the fix, they no longer crash. Behavior is the same in both normal scenarios and in AssemblyVersionAttribute scenarios (as far as I can tell). C# does give a warning about wildcard AssemblyVersion properties:
That seems to be the only difference between using the attribute and the msbuild property. |
...Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/MarkupCompiler/MarkupCompiler.cs
Outdated
Show resolved
Hide resolved
...Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/MarkupCompiler/MarkupCompiler.cs
Outdated
Show resolved
Hide resolved
...Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/MarkupCompiler/MarkupCompiler.cs
Outdated
Show resolved
Hide resolved
...Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/MarkupCompiler/MarkupCompiler.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/MarkupCompiler/VersionHelper.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Resources/xlf/Strings.cs.xlf
Show resolved
Hide resolved
src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/MarkupCompiler/VersionHelper.cs
Outdated
Show resolved
Hide resolved
Hello @rladuca! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
Thanks @vatsan-madhavan ! Now I understand the correlation between these tags on csproj file and Application.LoadComponent() method. |
@dotnet/wpf-developers Please write a nice doc for this and make it discoverable through public documentation so that the next person can learn about it more easily. Right now the only way to discover it is for someone in the know to make the correlation and point community-members to this PR and the associated issue. |
fixes #2517