Explanation

Code Analyzer has identified a variable that appears to be a struct. It also appears that this struct variable had one or more fields changed, but the code never uses the variable, nor is the variable returned. This scenario indicates that the assignment to the variable has no effect.


Suggested Action

Although Code Analyzer generates this message conservatively, it is possible for Code Analyzer to identify the variable incorrectly as a struct when it actually is an object. It is possible for an assignment to an object property to have side effects that make this assignment appropriate. If the object is a handle object, this usage is not only appropriate, but common.

If the message is appropriate, you can either:

If the message is inappropriate, do one of the following:

For details, see Adjust Code Analyzer Message Indicators and Messages.