Skip to content
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

Fix build script to work with VS2019 #641

Merged
merged 2 commits into from
Oct 17, 2019

Conversation

jimmylewis
Copy link
Contributor

The main change is to try to find msbuild using the 'Current' version
instead of the '15.0' version. The MSBuild team has stated that
'Current' will be used going forward to avoid a breaking change to the
path when the version revs.

Also necessary in this change was to drop the /toolsVersion flag from
msbuild. It was passing 15.0 but that tools version is not recognized in the
current MSBuild.

Lastly, added the UWP.Support component as a required build component.
When the build script picks an instance of VS missing this feature, the build
will fail when trying to import Microsoft.Windows.UI.Xaml.CSharp.Targets.

@jimmylewis
Copy link
Contributor Author

I submitted this as a possible fix for #605 before waiting for all the tasks in #606 to be completed. This issue has been filed a few times and is a pain point trying to debug the test framework or make other contributions.

@singhsarab
Copy link
Contributor

@jimmylewis The changes seem to have broken the build. Can you please take a look

@jimmylewis
Copy link
Contributor Author

@singhsarab is there a way to rerun the build with verbose logging enabled? I can't reproduce the failure locally, and I see that build.ps1 prints a lot of verbose steps that might help me track it down easier.

@singhsarab
Copy link
Contributor

The main change is to try to find msbuild using the 'Current' version
instead of the '15.0' version.  The MSBuild team has stated that
'Current' will be used going forward to avoid a breaking change to the
path when the version revs.

Also necessary in this change was to drop the /toolsVersion flag from
msbuild.  It was passing 15.0 but that tools version is not recognized in the
current MSBuild.

Lastly, added the UWP.Support component as a required build component.
When the build targets an instance of VS missing this feature, the build
will fail when trying to find Microsoft.Windows.UI.Xaml.CSharp.Targets.
@@ -117,6 +128,7 @@ function Locate-VsInstallPath($hasVsixExtension ="false"){

$requiredPackageIds += "Microsoft.Component.MSBuild"
$requiredPackageIds += "Microsoft.Net.Component.4.6.TargetingPack"
$requiredPackageIds += "Microsoft.VisualStudio.Windows.Build"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$requiredPackageIds += "Microsoft.VisualStudio.Windows.Build" [](start = 1, length = 62)

can you help me understand why this package is required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scripts/build/TestFx.targets contains:

<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" Condition="$(TargetPlatformIdentifier) == 'UAP'" />

This targets file is part of the Microsoft.VisualStudio.Windows.Build component. I ran into this because I have two instances of VS installed but the "latest" one has a very limited set of components. The build script selected it because it was installed more recently and matched the other two component IDs, but the build failed because it couldn't find the targets file.

@jayaranigarg jayaranigarg merged commit 2166170 into microsoft:master Oct 17, 2019
@jimmylewis jimmylewis deleted the fixBuildVS2019 branch April 1, 2020 07:17
This was referenced Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants