-
-
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
Wrong path for build tools when multitargeting #29
Comments
Interestingly, this only appears to affect loading of one project. One of the only differences between that project and the others is that it's multi-targeted:
So some combination of multi-targeting and the CI server appears to cause the issue. |
I think that's the error message I was getting when I reported #16, so I'll close it. |
@jp2masa Thanks - good to consolidate issues whenever we can. I've been working on this and have a failing test for it so hopefully I'll figure it out soon. |
Currently I'm working around this with a particularly nasty hack inspired by one of the linked threads: // HACK: https://github.com/daveaglick/Buildalyzer/issues/29
var dotnetSdkVersion = "2.0.0";
var extensionsPath = $@"C:\Program Files\dotnet\sdk\{dotnetSdkVersion}";
var msbuildSdkPath = $@"{extensionsPath}\SDKs";
Environment.SetEnvironmentVariable("VisualStudioVersion", "15.0");
Environment.SetEnvironmentVariable("MSBuildExtensionsPath", extensionsPath);
Environment.SetEnvironmentVariable("MSBuildSDKsPath", msbuildSdkPath);
Environment.SetEnvironmentVariable("VSINSTALLDIR", @"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\");
// END |
Interesting clue: when running from the test runner under .NET Core I get the following error
It's the same message but the path where it's looking for |
Opened an upstream issue at dotnet/msbuild#2846 |
A thought: maybe it makes sense to convert a multi-targeted project to a single target for Buildalyzer purposes. Is there a benefit to running the build with all the targets - if we're mainly looking for MSBuild properties like source files and csc arguments maybe we don't care about all the targets. |
Found this in
The |
I don't think that the properties need to be passed to the task, I already had some problems related to that. At least |
Resolved with the latest commit - ended up stripping multiple targets from project files and just building the first target. |
Seeing this error on CI builds:
The import in
Sdk.props
looks like this:It appears that
MSBuildToolsVersion
is getting set to "2.0" instead of "15.0" for some reason.Found a related issue in DocFx that perfectly describes this behavior here: dotnet/docfx#1752 (comment) (Buildalyzer already sets the
MSBuildExtensionsPath
).The text was updated successfully, but these errors were encountered: