相关文章推荐
聪明的啤酒  ·  svg ...·  10 月前    · 
温暖的鸵鸟  ·  CentOS7 ...·  1 年前    · 

I tried to override the $(MSBuildExtensionsPath) property of VS2019 using "Set MSBuildExtentionsPath="C:\ProgramFiles(x86)\MyCustomTargetsPath" ". But when projects are built with msbuild.exe from VS2019 installation path(C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin), then MSBuildExtensionsPath is pointing to default path instead of the overrided value which is not desired. But when projects are built with msbuild.exe from "C:\Windows\Microsoft.NET\Framework\v4.0.30319", then MSBuildExtensionsPath is pointing to overrided path which s desired one. So please resolve the issue with MSBuild.exe from "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin"

First I'll point out that your set command misspells the envvar name. So if you copied this from your script then you should fix your script and try again.

For issues related to MSBuild you should report them in Github where the dev team can look at the issue and either help you get it working or identify it as a bug to be resolved.

@Michael Taylor , no I didnt copy that from my script. Actually after set command, I have used echo to display whether that MSBuildExtensionsPath variable is set to expected path or not. And I see that its value is set to the path I gave. But even though, its value is set to the given path initially, when msbuild.exe is invoked in the makefile to build the projects, then when i see the build log file, msbuild.exe is considering the default path only . I want to know why this is happening with msbuild.exe from VS2019 installation path.

Most likely because it is getting initialized by the toolset. Report the issue in Github so the dev team can look at it and tell you whether it is by design or not. There have been fixes to the behavior of these sets of variables over the years and it might or might not be by design. The other thing that comes to my mind is whether it is an issue with x86 vs x64 versions of msbuild. But the dev team can answer that better.