-
-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSBUILD_EXE_PATH #42
Comments
I'm wondering if this could/should be used as an alternative to setting var ext = projectAnalyzer.GlobalProperties["MSBuildExtensionsPath"];
Environment.SetEnvironmentVariable("MSBUILD_EXE_PATH", Path.Combine(ext, "MSBuild.dll"));
projectAnalyzer.RemoveGlobalProperty(Buildalyzer.Environment.MsBuildProperties.MSBuildExtensionsPath);
projectAnalyzer.RemoveGlobalProperty(Buildalyzer.Environment.MsBuildProperties.MSBuildSDKsPath); Setting |
Interesting. Do you have to remove the global properties for the environment variable to work or will the environment variable do the trick even when the global properties are set? If the latter I’d say we should go ahead set both. If keeping the global properties makes it so the That’s the frustrating part about this project - it’s like whack-a-mole. You figure out how to get one build configuration to work and another one breaks. |
It works the same either way. If you remove the properties, then MSBuild sets them to the directory component of |
Cool - then I don’t see any problems with adding this as another environment variable that we set by default before running the build. |
Added this (it'll ship soon), but I'm setting Perhaps the bigger problem is why Buildalyzer was unable to locate your MSBuild at it's correct location at "/usr/local/share/dotnet/sdk/2.1.4/MSBuild.dll". That should have been reported by |
As far as I can tell, there isn't really anything wrong with Buildalyzer. As you noticed in the other issue you linked, the interactions between MSBuild properties is so complex that it is rather difficult to get the "expected" results. Other projects, such as docfx, suffer from the same sorts of problems with MSBuild. |
Buildalyzer 1.0.0 was released to NuGet last night. Can you please try it out when you get the chance and let me know the status of this issue? FYI - the Buildalyzer 1.0.0 API has changed significantly. Revised documentation is forthcoming, but I wanted to get the release out there ASAP. Hopefully you'll be able to figure out the differences, but if not the source code of the tests is a good place to look or wait until better docs are out next week. |
I just published Buildalyzer 2.0 which runs MSBuild out-of-process (as opposed to the old way of running it via MSBuild APIs). In general, if you can build it Buildalyzer should now be able to build it. Given how drastically different this new technique is, I'm closing all existing bug reports. Please try the new version and if you're still having problems, please open a new issue. |
This is more of an observation than an issue at this point.
I've been trying to use Buildalyzer (v0.2.3) with .NET Core on macOS. The log from Buildalyzer would show that my projects were failing to compile because it could not find
Microsoft.CSharp.targets
. The strange thing, though, was that the directory of the path name was my project directory rather than the .NET Sdk directory. Basically,MSBuildToolsPath
was wrong.After poking around the msbuild source code, I found that there is an
MSBUILD_EXE_PATH
environment variable that can be used to help get the correctMSBuildToolsPath
configured. If I set it like this:... then MSBuild (and therefore Buildalyzer) are happy.
The text was updated successfully, but these errors were encountered: