Warning running scanner

Hi, I noticed sometimes when I run the scanner it will fail because of the warnings below:

warning: failed to remove .sonarqube/bin/SonarScanner.MSBuild.Common.dll: Invalid argument
warning: failed to remove .sonarqube/bin/SonarScanner.MSBuild.Tasks.dll: Invalid argument

I tried to actually remove it manually and it says other process is using it.

After scanner done its job, the related .net core host (C:\Program Files\dotnet\dotnet.exe) are still running in the background and not killed. I have to end all the processes before I am able to remove those two dll.

I tried to kill the background process at the end of the scan as below and its actually working fine.
But I was thinking this may not be proper considering gitlab runner may run other task and perform scanning. What do you think?

- dotnet sonarscanner begin /k:"projectkey" /d:sonar.login="token"
- dotnet build $SOLUTION_PATH
- dotnet sonarscanner end /d:sonar.login="token"
- taskkill /IM "dotnet.exe" /F