Skip to content

Update preprocessor-pragma-warning.md - #7093

Closed
ghost wants to merge 2 commits into
masterfrom
unknown repository
Closed

Update preprocessor-pragma-warning.md#7093
ghost wants to merge 2 commits into
masterfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Aug 18, 2018

Copy link
Copy Markdown

The CS0414 warning has been changed to IDE0044.
As a consequence, we should remove or update this file:
docs/docs/csharp/misc/cs0414.md

The CS0414 warning has been changed to IDE0044.
As a consequence, we should remove or update this file:
docs/docs/csharp/misc/cs0414.md
@ghost
ghost requested a review from BillWagner as a code owner August 18, 2018 14:51

@BillWagner BillWagner left a comment

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.

Thanks for updating this @johnnyagerard

I did suggest a better fix than the one you supplied.

using System;

#pragma warning disable 414, CS3021
#pragma warning disable IDE0044, CS3021

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.

Instead of IDE0044 this should disable CS0414. The original, which only had 414 is misleading.

@ghost

ghost commented Aug 20, 2018

Copy link
Copy Markdown
Author

@BillWagner All right, now I understand.
So Visual Studio replaces the CS0414 and CS0169 warnings with IDE0044 'Make field readonly' message.
But the warnings still show up when using the command prompt.

@BillWagner

Copy link
Copy Markdown
Member

@johnnyagerard

So Visual Studio replaces the CS0414 and CS0169 warnings with IDE0044 'Make field readonly' message.
But the warnings still show up when using the command prompt.

Close. The CS* warnings are generated by the compiler. The IDE* warnings are generated by Visual Studio for suggested refactorings or code fixes. (The IDE* warnings often generate a lightbulb suggestion to change code.)

@ghost

ghost commented Aug 21, 2018

Copy link
Copy Markdown
Author

@BillWagner Well, now I have the exact explanation of what got me confused.
Usually, when someone copy/paste some code in Visual Studio, errors and warnings show up automatically right? But this is not the case for CS0414 and CS0169 warnings. You have to build the solution, or run the application first for these warnings to show up in the error list of Visual Studio. So this is indeed unrelated to IDE0044.

@ghost ghost closed this Sep 16, 2018
@ghost
ghost deleted the patch-16 branch September 16, 2018 20:14
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant