Closed jeremytammik closed 2 years ago
@NeVeSpl any idea why i get these warnings? are they expected? should they be ignored?
I tested ignoring these warnings and it works fine!
can i remove the async keywords?
Yes, you can remove async on those three methods, those methods are not used any longer anyway. Regarding the rest of warnings they can be suppressed in the code. Those warnings are usual, when some async code is called from sync code, but this is exactly what we want, to allow the command to finish without waiting for the end of the life of our form.
Severity Code Description Project File Line Suppression State Warning CS4014 Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. RevitLookup Y:\a\src\rvt\RevitLookup\CS\TestCmds.cs 110 Active Warning CS1998 This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. RevitLookup Y:\a\src\rvt\RevitLookup\CS\Snoop\Forms\ObjTreeBase.cs 325 Active Warning CS1998 This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. RevitLookup Y:\a\src\rvt\RevitLookup\CS\Snoop\Forms\ParamEnumSnoop.cs 349 Active Warning CS1998 This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. RevitLookup Y:\a\src\rvt\RevitLookup\CS\Snoop\Forms\Parameters.cs 377 Active Warning CS4014 Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. RevitLookup Y:\a\src\rvt\RevitLookup\CS\TestCmds.cs 74 Active Warning CS4014 Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. RevitLookup Y:\a\src\rvt\RevitLookup\CS\TestCmds.cs 88 Active Warning CS4014 Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. RevitLookup Y:\a\src\rvt\RevitLookup\CS\TestCmds.cs 99 Active Warning CS4014 Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. RevitLookup Y:\a\src\rvt\RevitLookup\CS\TestCmds.cs 128 Active Warning CS4014 Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. RevitLookup Y:\a\src\rvt\RevitLookup\CS\TestCmds.cs 142 Active Warning CS4014 Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. RevitLookup Y:\a\src\rvt\RevitLookup\CS\TestCmds.cs 157 Active Warning CS4014 Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. RevitLookup Y:\a\src\rvt\RevitLookup\CS\TestCmds.cs 171 Active