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

Turn on single-file analyzer and fix problems #5426

Merged
merged 3 commits into from
Aug 16, 2021
Merged

Conversation

agocke
Copy link
Member

@agocke agocke commented Aug 14, 2021

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
Copy link
Member

@RussKie RussKie left a comment

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]>
private static FileVersionInfo GetAppFileVersionInfo()
{
lock (s_internalSyncObject)
{
if (s_appFileVersion is null)
{
Type t = GetAppMainType();
if (t is not null)
if (t is not null && t.Assembly.Location.Length > 0)
Copy link
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
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