Turn on single-file analyzer and fix problems#5426
Merged
Conversation
RussKie
previously approved these changes
Aug 16, 2021
Co-authored-by: Igor Velikorossov <RussKie@users.noreply.github.com>
dreddy-work
reviewed
Aug 16, 2021
| { | ||
| Type t = GetAppMainType(); | ||
| if (t is not null) | ||
| if (t is not null && t.Assembly.Location.Length > 0) |
Member
There was a problem hiding this comment.
What made to add this second condition here?
Member
Author
There was a problem hiding this comment.
If this is in a single-file, t.Module.FullyQualifiedName will return <Unknown> and GetVersionInfo will fail. ExecutablePath should be single-file safe, however.
dreddy-work
approved these changes
Aug 16, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Should fully fix dotnet/runtime#44488
Proposed changes
This change turns on the single-file analyzer in the winforms repo, fixes the few real problems that were encountered, and suppresses warnings when issues are addressed.
Customer Impact
Full support for single-file publishing in WinForms, with some confidence that all issues are addressed.
Regression?
Risk
Very low.
Microsoft Reviewers: Open in CodeFlow