locked
.NET warnings at compile time RRS feed

  • Question

  • User-466227320 posted

    Hello All,

    Could anyone suggest whether .net warnings at compile time affects performance of application.

    There are 291 around  warnings comes when asp.net application is complied.  Thanks. 

     

    Monday, April 3, 2017 6:20 AM

All replies

  • User-1629691846 posted

    Warnings can affect the performance of the application.

    e.g. unused variables take memory etc.  Not using exception parameter in logging (In Exception handling).

    Warnings can also point-out some bugs like "Null reference exceptions" or methods which have been changed in the current .net framework.

    You should treat the warnings as errors. Then you will get the higher quality code.

    Monday, April 3, 2017 6:34 AM
  • User-2057865890 posted

    Hi Anupami,

    Could anyone suggest whether .net warnings at compile time affects performance of application.

    This can result in performance loss. 

    For Example

    CA1800: Do not cast unnecessarily
    Duplicate casts decrease performance, especially when the casts are performed in compact iteration statements.

    Most of the warnings indicates problems with your code. You should look into your code and fix them.

    Performance Warnings

    Best Regards,

    Chris

    Monday, April 3, 2017 8:10 AM