The out parameter 'parametername' must be assigned to before control leaves

The out parameter 'parametername' must be assigned to before control leaves


You get this error message when you use the "out" parameter using the out keyword. 

Learn more about out and ref parameters.


Resolution

To resolve this error, you must assign a value to the out parameter within the method. If the out parameter is used within a loop or statement, it must be used outside of that loop and must have a value assigned to it. 



Similar Articles
Mindcracker
Founded in 2003, Mindcracker is the authority in custom software development and innovation. We put best practices into action. We deliver solutions based on consumer and industry analysis.