Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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 @@ -2,6 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">net6.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>Latest</LangVersion>
<IsPackable>true</IsPackable>
Expand All @@ -11,6 +12,16 @@
<NoWarn>$(NoWarn);NU5127</NoWarn>
<EnableDefaultNoneItems>false</EnableDefaultNoneItems>
<RootNamespace>Microsoft.DotNet.Build.Tasks.Workloads</RootNamespace>

<!--
Only include WiX-powered features when running a non-from-source build. (For example, the
Microsoft build used to build .NET for Windows.)

This removes a dependency on prebuilt WiX binaries. The purpose of WiX is to produce Windows
installers, and source-build doesn't run on Windows, so excluding WiX while building in
source-build mode to remove the prebuilt dependency has no impact to available .NET features.
-->
<IncludeWiX Condition="'$(DotNetBuildFromSource)' != 'true'">true</IncludeWiX>
</PropertyGroup>

<ItemGroup>
Expand All @@ -19,13 +30,16 @@
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="$(MicrosoftBuildTasksCoreVersion)" />
<PackageReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkVersion)" />
<PackageReference Include="NuGet.Packaging" Version="$(NuGetVersion)" />
<PackageReference Include="Wix" Version="3.11.2" />
<PackageReference Include="Microsoft.NET.Sdk.WorkloadManifestReader" Version="$(MicrosoftNetSdkWorkloadManifestReaderVersion)" />
<PackageReference Include="System.Text.Json" Version="$(SystemTextJsonVersion)" Condition="'$(TargetFramework)' == 'net472'"/>
<PackageReference Include="System.Text.Json" Version="$(SystemTextJsonVersion)" Condition="'$(TargetFramework)' == 'net472'" />
<PackageReference Include="Microsoft.Deployment.DotNet.Releases" Version="$(MicrosoftDeploymentDotNetReleasesVersion)" />
</ItemGroup>

<ItemGroup>
<ItemGroup Condition="'$(IncludeWiX)' == 'true'">
<PackageReference Include="Wix" Version="3.11.2" />
</ItemGroup>

<ItemGroup Condition="'$(IncludeWiX)' == 'true'">
<Reference Include="$(WixInstallPath)\Microsoft.Deployment.Resources.dll" />
<Reference Include="$(WixInstallPath)\Microsoft.Deployment.Compression.dll" />
<Reference Include="$(WixInstallPath)\Microsoft.Deployment.Compression.Cab.dll" />
Expand All @@ -48,6 +62,10 @@
<EmbeddedResource Remove="obj\**" />
</ItemGroup>

<ItemGroup Condition="'$(IncludeWiX)' != 'true'">
<Compile Remove="**\*.wix.cs" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Misc\*.*" />
<EmbeddedResource Include="MsiTemplate\*.wxs" />
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.DotNet.Build.Tasks.Workloads/src/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public static Guid CreateUuid(Guid namespaceUuid, string name)
Buffer.BlockCopy(nameBytes, 0, hashBuffer, 16, nameBytes.Length);
byte[] hash;

using (SHA256 sha256 = new SHA256Managed())
using (SHA256 sha256 = SHA256.Create())
{
hash = sha256.ComputeHash(hashBuffer);
}
Expand Down
3 changes: 3 additions & 0 deletions src/Microsoft.DotNet.SharedFramework.Sdk/sdk/Sdk.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
<PropertyGroup Condition="'$(DotNetSharedFrameworkTaskDir)' == ''">
<DotNetSharedFrameworkTaskDir Condition="'$(MSBuildRuntimeType)' == 'core'">$(MSBuildThisFileDirectory)../tools/netcoreapp3.1/</DotNetSharedFrameworkTaskDir>
<DotNetSharedFrameworkTaskDir Condition="'$(MSBuildRuntimeType)' != 'core'">$(MSBuildThisFileDirectory)../tools/net472/</DotNetSharedFrameworkTaskDir>

<!-- Workaround for https://github.com/dotnet/arcade/issues/7413 -->
<DotNetSharedFrameworkTaskDir Condition="'$(MSBuildRuntimeType)' == 'core' and '$(DotNetBuildFromSource)' == 'true'">$(MSBuildThisFileDirectory)../tools/net6.0/</DotNetSharedFrameworkTaskDir>
</PropertyGroup>

<PropertyGroup>
Expand Down