Skip to content

Turn on single-file analyzer and fix problems - #5426

Merged
agocke merged 3 commits into
dotnet:mainfrom
agocke:single-file
Aug 16, 2021
Merged

agocke merged 3 commits into
dotnet:mainfrom
agocke:single-file

Conversation

@agocke

@agocke agocke commented Aug 14, 2021 •

Copy link
Copy Markdown
Member

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?

  • No

Risk

Very low.

Microsoft Reviewers: Open in CodeFlow

@agocke
agocke requested a review from a team as a code owner August 14, 2021 00:57
@ghost ghost assigned agocke Aug 14, 2021
@RussKie
RussKie self-requested a review August 14, 2021 07:15
RussKie
RussKie previously approved these changes Aug 16, 2021

@RussKie RussKie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@RussKie RussKie added the waiting-author-feedback The team requires more information from the author label Aug 16, 2021
@ghost ghost removed the waiting-author-feedback The team requires more information from the author label Aug 16, 2021
Co-authored-by: Igor Velikorossov <[email protected]>
{
Type t = GetAppMainType();
if (t is not null)
if (t is not null && t.Assembly.Location.Length > 0)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What made to add this second condition here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If this is in a single-file, t.Module.FullyQualifiedName will return <Unknown> and GetVersionInfo will fail. ExecutablePath should be single-file safe, however.

@agocke
agocke merged commit edd3aa5 into dotnet:main Aug 16, 2021
@ghost ghost added this to the 6.0 rc1 milestone Aug 16, 2021
@agocke
agocke deleted the single-file branch August 16, 2021 19:38
@ghost ghost locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improvements to single-file analysis

3 participants