Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do compiler gives error instead of warning for variable which is assigned but its value is never used

I know there are lot of question which is asked previously about

The variable which is assigned but its value is never used

Here,Here and Here

I am getting compile time Error instead of warning which causes compile or rebuild to fail. i didn't update my Visual studio 2015 nor do i installed any VS extension

so my question is what can i do so Visual studio show warning instead of Compile time Error.

enter image description here

like image 381
tabby Avatar asked Sep 14 '25 11:09

tabby


1 Answers

In the project-properties is a setting "Treat warnings as errors" which you apparently switched on.

project-properties

To undo: Project->Properties->Build->Treat warnings as errors->None
(None is the default-setting for new projects.)

Read this for reference.

Note:
It's certainly still a good idea to set this setting to All, to ensure the code is error- and "garbage"-free.

like image 197
MatSnow Avatar answered Sep 17 '25 00:09

MatSnow