# Why deprecated MsBuild 14/15 warning appears if I am using VS 2022 Build Tools?

**URL:** <https://community.sonarsource.com/t/why-deprecated-msbuild-14-15-warning-appears-if-i-am-using-vs-2022-build-tools/113582>\
**Category:** SonarQube Server / Community Build\
**Tags:** warning, msbuild, dotnet, sonarqube, scanner\
**Created:** [April 17, 2024, 6:50am UTC](https://community.sonarsource.com/t/why-deprecated-msbuild-14-15-warning-appears-if-i-am-using-vs-2022-build-tools/113582 "2024-04-17T06:50:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kricer](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/kricer/32/42007_2.png) [@kricer](https://community.sonarsource.com/u/kricer)\
**Post date:** [April 17, 2024, 6:50am UTC](https://community.sonarsource.com/t/why-deprecated-msbuild-14-15-warning-appears-if-i-am-using-vs-2022-build-tools/113582/1 "2024-04-17T06:50:14Z")

</div>

Hi,

I hope you can help me to remove a warning I do not understand its origin. I have the following environment:

- **Language** : c# (.Net Framework v4.8)
- **MsBuild path** : C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\msbuild.exe
- **SonarScanner** : SonarScanner for MSBuild 5.13 (Using the .NET Core version of the Scanner for MSBuild)
- **SonarQube** : Standalone community, version 10.3.0.82913

In the SonarQube page of my project, there is a warning displayed _The last analysis has warnings_, wit the following content:  
`Analysis using MsBuild 14 and 15 build tools is deprecated. Please update your pipeline to MsBuild 16 or higher.`

I do not understand why the SonarScanner detects MsBuild 14 or 15, as I am using version 17 (according to the MsBuild path).

Please also note, that the .csproy files do have properties set `ToolsVersion="15.0"` or even older, in the `Project` xml tag but I understand, with newer MsBuild, they get ignored.

Please tell me how to remove the warning.

Thank you.

---

<div class="post-metadata">

**Author:** ![cristian.ambrosini](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/cristian.ambrosini/32/48593_2.png) [@cristian.ambrosini](https://community.sonarsource.com/u/cristian.ambrosini)\
**Post date:** [April 19, 2024, 9:33am UTC](https://community.sonarsource.com/t/why-deprecated-msbuild-14-15-warning-appears-if-i-am-using-vs-2022-build-tools/113582/4 "2024-04-19T09:33:12Z")

</div>

Hi @kricer!  
Let’s see if I can help. I have the feeling that you are using an old version of the analyzer, we worked on those warnings back in January, and starting from version _9.19.0.84025_, they should report a slightly different message with an improved detection method.  
It does this by checking if the **Roslyn version** :

- it’s v1, which is associated with Visual Studio 2015 → MsBuild 14:

> `The analysis using MsBuild 14 is no longer supported and the analysis with MsBuild 15 is deprecated. Please update your pipeline to MsBuild 16 or higher.`

- it’s v2, which is associated with Visual Studio 2017 → MsBuild 15:

> The analysis using MsBuild 15 is deprecated. Please update your pipeline to MsBuild 16 or higher.

- it’s \>= v3, then you should see no errors in your logs.

Can you update to the latest SQ version _10.5_ and see if the issue still reproduces?

---

<div class="post-metadata">

**Author:** ![kricer](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/kricer/32/42007_2.png) [@kricer](https://community.sonarsource.com/u/kricer)\
**Post date:** [July 12, 2024, 9:27am UTC](https://community.sonarsource.com/t/why-deprecated-msbuild-14-15-warning-appears-if-i-am-using-vs-2022-build-tools/113582/5 "2024-07-12T09:27:31Z")

</div>

Hi Cristian,

I have checked the **Roslyn version** :‘4.9.0-3.24121.1 (a98c90d5)’  
Than it took a while and I installed the latest SQ v10.6 (92116) and the latest SonarScanner for MSBuild 6.2 (although in the logy I can also see “SonarScanner 5.0.1.3006”).

Unfortunately, the warning persists:

```auto
The analysis using MsBuild 14 is no longer supported and the analysis with MsBuild 15 is deprecated. Please update your pipeline to MsBuild 16 or higher.

```

Do you have any other suggestion?  
Thanks

---

<div class="post-metadata">

**Author:** ![cristian.ambrosini](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/cristian.ambrosini/32/48593_2.png) [@cristian.ambrosini](https://community.sonarsource.com/u/cristian.ambrosini)\
**Post date:** [September 30, 2024, 1:28pm UTC](https://community.sonarsource.com/t/why-deprecated-msbuild-14-15-warning-appears-if-i-am-using-vs-2022-build-tools/113582/7 "2024-09-30T13:28:55Z")

</div>

Hi @kricer, sorry for the delay, I’m back now on the matter.

Ok, we are taking some steps forward. Now the warning is different compared to the previous one and it’s actually reporting

```auto
The analysis using MsBuild 14 is no longer supported and the analysis with MsBuild 15 is deprecated. Please update your pipeline to MsBuild 16 or higher.

```

which is the actual warning we log if we detect a Roslyn version 1.x.x associated with Visual Studio 2015 → MsBuild 14.

Can you please verify whether the machine has multiple versions of Visual Studio and/or MSBuild tools installed?
