question

johnjohn-0472 avatar image
0 Votes"
johnjohn-0472 asked JackJJun-MSFT edited

Run a project inside Visual studio 2019 will raise thsi error :- DotNet\Microsoft.DotNet.Props" was not found

I have a project .sln which i want to build inside Visual studio community 2019, but when i do so , i get this error:-

 Severity Code Description Project File Line Suppression State Error MSB4226 The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\DotNet\Microsoft.DotNet.Props" was not found. Also, tried to find "DotNet\Microsoft.DotNet.Props" in the fallback search path(s) for $(VSToolsPath) - "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v16.0" . These search paths are defined in "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe.Config". Confirm that the path in the declaration is correct, and that the file exists on disk in one of the search paths. C:\c\tree\master\cloud\src\Helper Utilities\Microsoft.Legal.MatterCenter.HelperUtilities\Microsoft.Legal.MatterCenter.HelperUtilities.sln C:\c\tree\master\cloud\src\Helper Utilities\Microsoft.Legal.MatterCenter.HelperUtilities\Microsoft.Legal.ProjectCenter.UpdateProjectName\Microsoft.Legal.ProjectCenter.UpdateProjectName.xproj 8

Although i have installed .net core SDK, and i have this version for it:-

 C:\WINDOWS\system32>dotnet --version
 6.0.301

so why i am getting this error?



vs-msbuild
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Bruce-SqlWork avatar image
0 Votes"
Bruce-SqlWork answered Bruce-SqlWork edited

the project file (msbuild) is referencing a ms build script that is not installed. this generally means you did not install a required visual studio workload.

you should check the project file to see what platform it is building for, and be sure support for that platform is installed in visual studio.

in your case you will see .net 6 support is not installed (as it is not supported by vs 2019).







5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.