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

[msbuild] Use MSBuild assemblies from NuGet instead of Mono's installation. #21471

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<NoWarn>$(NoWarn);NU1603</NoWarn> <!-- Xamarin.Messaging.Build.Common 1.6.24 depends on Merq (>= 1.1.0) but Merq 1.1.0 was not found. An approximate best match of Merq 1.1.4 was resolved. -->
<NoWarn>$(NoWarn);MSB3277</NoWarn> <!-- warning MSB3277: Found conflicts between different versions of "System.IO.Compression" that could not be resolved. -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<MonoMSBuildBinPath>/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin</MonoMSBuildBinPath>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<WarningsAsErrors>Nullable</WarningsAsErrors>
Expand All @@ -29,18 +28,10 @@
</ItemGroup>

<ItemGroup>
<Reference Include="Microsoft.Build">
<HintPath>$(MonoMSBuildBinPath)/Microsoft.Build.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Build.Framework">
<HintPath>$(MonoMSBuildBinPath)/Microsoft.Build.Framework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Build.Tasks.Core">
<HintPath>$(MonoMSBuildBinPath)/Microsoft.Build.Tasks.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Build.Utilities.Core">
<HintPath>$(MonoMSBuildBinPath)/Microsoft.Build.Utilities.Core.dll</HintPath>
</Reference>
<PackageReference Include="Microsoft.Build" Version="15.1.548" />
<PackageReference Include="Microsoft.Build.Framework" Version="15.1.548" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="15.1.548" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.1.548" />
Copy link
Member

Choose a reason for hiding this comment

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

@rolfbjarne Any reason to not use latest version? I am just concerned that we may bring security issues this way.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if we need to keep the old versions at this point. I think we could try bumping to newer ones and test it. What do the task assemblies depend on?

Copy link
Member Author

Choose a reason for hiding this comment

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

Trying with the latest, let's see what CI says.

@emaf what's the latest desktop TFM that works in VS? Can we use "net4.8.1" or do we have to use something older?

I'm asking because we're building for netstandard2.0 in some of the projects, and that results in this warning:

warning NU1701: Package 'Microsoft.Build 17.11.4' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.

Copy link
Member Author

Choose a reason for hiding this comment

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

@emaf Looks like using the latest versions is fine, but note that we're not running any tests from within VS, so if this breaks VS on Windows, our tests won't detect it.

Copy link
Contributor

Choose a reason for hiding this comment

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

As the build agent does not directly interact with VS, it should not make any difference. I gave this a quick try and seems to work fine.

<Compile Include="..\..\Versions.g.cs">
<Link>Versions.g.cs</Link>
</Compile>
Expand Down