Skip to content
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 Missing Resources Exception leading to VS Designer crash #4310

Merged
merged 4 commits into from
Oct 13, 2021

Conversation

Nirmal4G
Copy link
Contributor

Fixes #4279

In addition to fixing the incorrect RootNamespace, Icon naming is simplified and EmbeddedResource items will now properly nest the generated sources.

See individual commit info more details.

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Refactoring (no functional changes, no api changes)

What is the current behavior?

VS Designer crashes due to missing resources. The actual problem is that the RootNamespace is wrong and it generates incorrect manifest. This leads to missing resources when ResourceManager tries to resolve the embedded files.

What is the new behavior?

Fixed the Namespace to use correct the RootNamspace both in sources and in project files.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
  • Header has been added to all new source files (run build/UpdateHeaders.bat)
  • Contains NO breaking changes

Other information

  • If you're editing this patch tree, please rebase on latest HEAD and then commit, without updating from the latest HEAD.
  • When merging, please update the commit title to PR title instead of the default Merge pull request #xxxx from repo/branch, and commit message to either PR message or messages of individual commits. The auto-merge bot does this by default.

It just takes up too much space in the DLL's size.
The "EmbeddedResourceUseDependentUponConvention" does not automatically nest the generated sources to its parent files.
This leads to embedded resources being not found and the VS Designer crashes
Since, we only use the same Root Namespace for all controls, we don't need to specify them.
@ghost
Copy link

ghost commented Oct 12, 2021

Thanks Nirmal4G for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌

@ghost ghost requested review from michael-hawker and azchohfi October 12, 2021 04:51
@ghost ghost added bug 🐛 An unexpected issue that highlights incorrect behavior designer bug 🐛 labels Oct 12, 2021
@Nirmal4G Nirmal4G force-pushed the hotfix/design-tools branch 5 times, most recently from 92cb60f to c5d4a5b Compare October 12, 2021 08:51
@Nirmal4G
Copy link
Contributor Author

@michael-hawker All done. The Designer no longer crashes for me in both VS16 and VS17 IDEs. Can you check and confirm?

Copy link
Member

@michael-hawker michael-hawker left a comment

Choose a reason for hiding this comment

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

Tested with the Layout package in a VS 2019 file new project. Was failing with 7.1, updated package and worked great. Thanks @Nirmal4G for figuring this out! 🦙❤

@XAML-Knight want to test this out with another package or two on your side? I didn't check about hot reload failing with 7.1, but was working fine with the new layout package.

@XAML-Knight
Copy link
Contributor

Bug fix confirmed. Was only able to repro XAML Hot reload VS crash once (VS 2019, 16.11.3, x86).

  • For the hot reload repro that did work, was not able to repro it until after following the ReadMe.txt's instructions on adding XamlControlsResources to the App.xaml. Packages installed were: 1) Microsoft.Toolkit.Uwp.UI.Controls; and 2) Microsoft.Toolkit.Uwp.UI.Animations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior designer bug 🐛 hotfix 🌶 priority 🚩
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VS Designer crash: MissingManifestResourceException
3 participants