-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Missing StaticResource should throw exception also in Debug #15602
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
Comments
@StephaneDelcroix thoughts? |
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process. |
the exception might be swallowed by the instrumentation |
both throw in the context of unit tests, so my gut feel of instrumentation swallowing the exception might be somehow right. checking |
@chabiss thoughts ? |
Static Analysis in the language service might be a possibility adding @mgoertz-msft |
Any feedback on this issue? |
I found this issue today by accidentaly removing a StaticResource that was referenced by all my buttons. The issue did not produce any warning on Debug when compiling and it built during release also without warnings. Buttons still worked in Debug but in Release all buttons stopped working (not even with a crash, the buttons simply don't do anything at all). There is a possible workaround: replace |
Verified this issue with Visual Studio Enterprise 17.9.0 Preview 3. Can repro on Windows platforms with sample project. |
Hi @@danardelean. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version. You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
Description
The current version of MAUI does not throw an exception in debug if a StaticResource is missing. The behaviour is inconsistent with Xamarin.Forms but the bigger problem comes in Release mode where the application does crash if the StaticResource is missing but the error message is not "readable" in Release
The missing StaticResource should throw exception also in Debug in order to be able to catch this error before compiling in Release and not understanding what is going on
Steps to Reproduce
Use the attached repository or any MAUI application that uses a StaticResource that is missing and build it in Debug and Release.
In Debug you won't have errors while running the application in Release the application will throw but with almost no way to know what generated the problem
Link to public reproduction project repository
https://github.com/danardelean/MauiStaticResourceProblem
Version with bug
7.0.49
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android, Windows, macOS
Affected platform versions
All
Did you find any workaround?
No
Relevant log output
No response
The text was updated successfully, but these errors were encountered: