SonarQube impacting seperate agent job?

Hi Duncan,

I’ve added a build step as you suggest to delete the .targets file from the agent’s working directory and I can see it’s being deleted as expected:

2019-10-17T09:23:09.4926320Z ##[debug]rm -rf C:\agent\_work\67\.sonarqube\bin\targets\SonarQube.Integration.targets

However, it’s still picking up the SonarQube configuration from the following location:

2019-10-17T09:23:42.4015045Z ##[debug]MSBuild: Property reassignment: $(SonarQubeBuildDirectory)="C:\agent\_work\67" (previous value: "") at C:\Users\{svc_account}\AppData\Local\Microsoft\MSBuild\4.0\Microsoft.Common.targets\ImportBefore\SonarQube.Integration.ImportBefore.targets (10,5)

And generating a new error:

2019-10-17T09:23:42.4931398Z ##[warning]|Error: ERROR C:\Users\svc_devbuildfiles\AppData\Local\Microsoft\MSBuild\4.0\Microsoft.Common.targets\ImportBefore\SonarQube.Integration.ImportBefore.targets(62,5): The build is configured to run SonarQube analysis but the SonarQube analysis targets could not be located. Project: Intelligence.sqlproj
2019-10-17T09:23:42.4932860Z ##[debug]Processed: ##vso[task.logissue type=warning]|Error: ERROR C:\Users\{svc_account}\AppData\Local\Microsoft\MSBuild\4.0\Microsoft.Common.targets\ImportBefore\SonarQube.Integration.ImportBefore.targets(62,5): The build is configured to run SonarQube analysis but the SonarQube analysis targets could not be located. Project: Intelligence.sqlproj

Thanks again for your help, I feel we’re really close and I’m desperately trying to avoid needing to run the agents as different users as this will require some extensive re-setup!