Comments (8)
I'm wondering if this could/should be used as an alternative to setting MSBuildExtensionsPath
and MSBuildSDKsPath
. For example, this seems to be working:
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 RoslynTargetsPath
still seems necessary though.
from buildalyzer.
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 MSBUILD_EXE_PATH
environment variable is ignored and we have to remove them, then I’d want to be sure we’re not fixing one case by breaking another build configuration that depends on those global properties but not the environment variable.
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.
from buildalyzer.
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?
It works the same either way. If you remove the properties, then MSBuild sets them to the directory component of MSBUILD_EXE_PATH
, so they end up with the same value that Buildalizer uses. There is certainly no harm in leaving it the way it is.
from buildalyzer.
Cool - then I don’t see any problems with adding this as another environment variable that we set by default before running the build.
from buildalyzer.
Added this (it'll ship soon), but I'm setting MSBUILD_EXE_PATH
to the same value as MSBuildToolsPath
right now. That should help resolve some issues I noticed with VS (see #48). The way it'll work is that MSBUILD_EXE_PATH
will get set to where Buildalyzer thinks it should be, but we'll honor a custom MSBUILD_EXE_PATH
if it's already set (and adjust the tools path accordingly).
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 dotnet --info
which is what Buildalyzer uses for the check.
from buildalyzer.
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.
from buildalyzer.
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.
from buildalyzer.
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.
from buildalyzer.
Related Issues (20)
- Support for .Net Standard 2.0 HOT 2
- `PublishSingleFile` breaks `IProjectAnalyzer.Build()` HOT 17
- Version number not available for packages added using GlobalPackageReference in Directory.Packages.props HOT 7
- Unsupported log file version HOT 8
- Cache dotnet info results per global.json file HOT 5
- Error when trying to read dotnet --info HOT 3
- multiple Buildalyzer.Tests unit tests are failing HOT 3
- Make working directory used by ProcessRunner configurable HOT 3
- [Discussion] Calling `GetCompilationAsync` on ASP.NET Framework project returns empty compilation HOT 3
- Help offered HOT 1
- Could not load file or assembly `NuGet.Frameworks` HOT 16
- Build/assembly reference not found errors due to random sorting of the projects in the Workspace when loading projects from solution file HOT 9
- Xml documentation is missing for imported symbols in Roslyn Projects HOT 3
- Looking For A New Maintainer HOT 4
- Sponsoring HOT 4
- Coding style, static code analysis, and versioning HOT 15
- Immutability HOT 3
- Targeting netstandard HOT 1
- Error running on macos-14-arm64 image
- Buildalyzer hangs if build does not start
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from buildalyzer.