Nesting "using" statements resolves in error Follow
As you can see from the screenshots below, nesting "using" statements gives a syntax error unless each using statement is wrapped in a curly brace.
This behavior is completely supported and works in Visual Studio.
If you were to disable the warnings, the file gets formatted with everything nested, making it not ideal and hard to read.
This is the expected behavior
When using Resharper with Visual Studio, it behaves the same way.
The reason why nested "using" need to be supported is for popular libraries like Serilog requiring this type of structure to add more context to logs.
Thanks!
Please sign in to leave a comment.
Hello,
Please change the following settings to avoid the specified behavior:
Please let me know if you have any more questions.
Thank you.