-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
InvalidArgumentException
raised by ExpressionNode
in _release_ mode
#4011
Comments
Hello vgromfeld, thank you for opening an issue with us! I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌 |
FYI @Sergio0694 |
@vgromfeld since you've identified the code line, did you have a chance to try changing that and seeing if it makes an improvement? Did you want to submit a PR? |
Huh, that's interesting that the missing metadata actually causes such a visible behavioral difference there 🤔 |
It looks like we could replace the magic string with the type with what the Pipeline builder uses to create a unique string: // Ensure we have a unique name for each object in our expression.
string paramName = Guid.NewGuid().ToUppercaseAsciiLetters(); It seems like this reference is pulled up from the hash when needed, so it shouldn't matter what the string is as long as it's unique and confines to the requirements for the Comp APIs. @Sergio0694 said he's going to optimize that method and move it to a central location for both places to use. |
) ## Closes #4011 <!-- Add the relevant issue number after the "#" mentioned above (for ex: Fixes #1234) which will automatically close the issue once the PR is merged. --> <!-- Add a brief overview here of the feature/bug & fix. --> ## PR Type What kind of change does this PR introduce? <!-- Please uncomment one or more that apply to this PR. --> - Bugfix <!-- - Feature --> <!-- - Code style update (formatting) --> <!-- - Refactoring (no functional changes, no api changes) --> <!-- - Build or CI related changes --> <!-- - Documentation content changes --> <!-- - Sample app changes --> <!-- - Other... Please describe: --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying, or link to a relevant issue. --> Crash with .NET Native, documented in the related issue. ## What is the new behavior? <!-- Describe how was this issue resolved or changed? --> The logic has been changed to not rely on APIs that might have a behavioral change under .NET Native. ## PR Checklist Please check if your PR fulfills the following requirements: - [X] Tested code with current [supported SDKs](../readme.md#supported) - [ ] ~~Pull Request has been submitted to the documentation repository [instructions](..\contributing.md#docs). Link: <!-- docs PR link -->~~ - [ ] ~~Sample in sample app has been added / updated (for bug fixes / features)~~ - [ ] ~~Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/windows-toolkit/WindowsCommunityToolkit-design-assets)~~ - [X] New major technical changes in the toolkit have or will be added to the [Wiki](https://github.com/windows-toolkit/WindowsCommunityToolkit/wiki) e.g. build changes, source generators, testing infrastructure, sample creation changes, etc... - [X] Tests for the changes have been added (for bug fixes / features) (if applicable) - [X] Header has been added to all new source files (run *build/UpdateHeaders.bat*) - [X] Contains **NO** breaking changes
Describe the bug
The animation expression builder is throwing an
InvalidArgumentException
in release mode when removing all the .Net Native directives fromdefault.rd.xml
.Steps to Reproduce
Steps to reproduce the behavior:
ExpressionBuiilder.zip
Expected behavior
The apps works (as when compiled in debug mode).
Additional context
The generated name for some properties is not valid.

Here is what we get in debug:
Here is what we have in release:

The issue comes from https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/1e0f17415eae2fd69dc207674b6019ed8656fec2/Microsoft.Toolkit.Uwp.UI.Animations/Expressions/ExpressionNodes/ExpressionNode.cs#L291
Which is not returning a valid string for the composition API. We should remove the
:
from the returned strings (the .Net Native generated type name when all the reflection code is removed).Workaround
The current workaround is to force .Net Native to keep all the symbols for
Windows.UI.Composition.CompositionPropertySet
by using the followingDefault.rd.xml
configuration:The text was updated successfully, but these errors were encountered: