There are a lot of Question and Answer about the async void
theme. And we all agree this is not a good thing, and I believe in all cases is avoidable. That Is why I want to create a Visual Studio Error Message when it is used.
In other cases it was success, like: When a function returns with Task
the visual studio makes a warning CS4014. And we configured the handle to this warning as error with Directory.Build.props mechanism. Here is the code of it:
<Project>
<PropertyGroup>
<WarningsAsErrors>CS4014</WarningsAsErrors>
</PropertyGroup>
</Project>
As you can see the CS4014 as handled like an error. It is works fine. But for async void
there is no warning message, that is why we cannot configure to handle this as an error.
Is there any way to add custom error/warning messages to msbuild
build process?
To create own error/warning messages will be very helpful in lot of cases.