* Populate target framework versions for tasks, and generated nugets based
.. on other properties, instead of hardcoding the values.
* Version substitution for MonoTargets nuget
* Version substitution for MonoAOTCompiler nuget
* sendhelixhelp.proj: Ensure that DotNetCliVersion gets overridden, as
.. intended. This seems to have been broken by the condition being
removed in
https://github.com/dotnet/arcade/commit/
cfdac3560f1c887780bac171df7c22f7805e6f40
from the `DotNetCliVersion` property, causing the value to always
overridden again to `6.0.100`.
And this breaks wasm aot/eat tests on helix:
```
/datadisks/disk1/work/
A4EE08D9/p/build/wasm/WasmApp.Native.targets(569,5): error MSB4062: The "MonoAOTCompiler" task could not be loaded from the assembly /datadisks/disk1/work/
A4EE08D9/p/build/MonoAOTCompiler/MonoAOTCompiler.dll. Could not load file or assembly 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=
b03f5f7f11d50a3a'. The system cannot find the file specified. [/datadisks/disk1/work/
A4EE08D9/w/
B3AE0955/e/publish/ProxyProjectForAOTOnHelix.proj]
/datadisks/disk1/work/
A4EE08D9/p/build/wasm/WasmApp.Native.targets(569,5): error MSB4062: Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
```
* Fix build for net7.0
Fails with:
```
src/tests/tracing/eventpipe/common/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcSocket.cs(27,35): error CS0108: 'IpcSocket.AcceptAsync(CancellationToken)' hides inherited member 'Socket.AcceptAsync(CancellationToken)'. Use the new keyword if hiding was intended. [/__w/1/s/src/tests/tracing/eventpipe/common/Microsoft.Diagnostics.NETCore.Client/Microsoft.Diagnostics.NETCore.Client.csproj]
```
* Fix some more target frameworks
* bump the workload sdk version
* Revert "sendhelixhelp.proj: Ensure that DotNetCliVersion gets overridden, as"
This reverts commit
426b4b19155d54a7f338140f4c87feec471b5d92.
Last update to Arcade's XHarnessRunner.targets unconditionally set
DotNetCliVersion, to workaround which this commit was added. But the
update in this PR changed DotNetCliPackageType to `aspnetcore-runtime`,
which makes the version from global.json - `6.0.100` incorrect for
aspnetcore.
And the next upcoming update will set versions explicitly and change the
DotNetCliPackageType back to `sdk`.
Instead, revert this. And don't use version from global.json for now,
instead relying on the version that xharnesrunner.targets sets.
Co-authored-by: Ankit Jain <radical@gmail.com>
<NetFrameworkToolCurrent>net472</NetFrameworkToolCurrent>
<!-- Don't build for NETFramework during source-build. -->
<NetFrameworkToolCurrent Condition="'$(DotNetBuildFromSource)' == 'true'" />
+
+ <TargetFrameworkForNETFrameworkTasks>$(NetFrameworkToolCurrent)</TargetFrameworkForNETFrameworkTasks>
+ <!-- Don't build for NETFramework during source-build. -->
+ <TargetFrameworkForNETFrameworkTasks Condition="'$(DotNetBuildFromSource)' == 'true'" />
+
+ <TargetFrameworkForNETCoreTasks>$(NetCoreAppToolCurrent)</TargetFrameworkForNETCoreTasks>
</PropertyGroup>
<PropertyGroup>
<When Condition="'$(NeedsEMSDK)' == 'true'">
<PropertyGroup>
<NeedsDotNetSdk>true</NeedsDotNetSdk>
- <UseDotNetCliVersionFromGlobalJson>true</UseDotNetCliVersionFromGlobalJson>
+ <!--<UseDotNetCliVersionFromGlobalJson>true</UseDotNetCliVersionFromGlobalJson>-->
<IncludeXHarnessCli>true</IncludeXHarnessCli>
<EnableXHarnessTelemetry>false</EnableXHarnessTelemetry>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoTasksDir)AotCompilerTask\MonoAOTCompiler.csproj" />
- <PackageFile Include="Sdk\Sdk.props" TargetPath="Sdk" />
<PackageFile Include="build\$(MSBuildProjectName).props" TargetPath="build" />
</ItemGroup>
+ <Target Name="_PrepareForPack" BeforeTargets="GetPackageFiles">
+ <PropertyGroup>
+ <SdkPropsPath>$(IntermediateOutputPath)Sdk.props</SdkPropsPath>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <_ReplacementValue Include="TargetFrameworkForNETCoreTasks" Value="$(TargetFrameworkForNETCoreTasks)" />
+ <_ReplacementValue Include="TargetFrameworkForNETFrameworkTasks" Value="$(TargetFrameworkForNETFrameworkTasks)" />
+ </ItemGroup>
+
+ <GenerateFileFromTemplate
+ TemplateFile="Sdk/Sdk.props.in"
+ Properties="@(_ReplacementValue)"
+ OutputPath="$(SdkPropsPath)" />
+
+ <ItemGroup>
+ <PackageFile Include="$(SdkPropsPath)" TargetPath="Sdk" />
+ </ItemGroup>
+ </Target>
+
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
</Project>
+++ /dev/null
-<Project>
- <PropertyGroup>
- <MonoAOTCompilerTasksAssemblyPath Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tasks\net6.0\MonoAOTCompiler.dll</MonoAOTCompilerTasksAssemblyPath>
- <MonoAOTCompilerTasksAssemblyPath Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tasks\net472\MonoAOTCompiler.dll</MonoAOTCompilerTasksAssemblyPath>
- </PropertyGroup>
- <UsingTask TaskName="MonoAOTCompiler" AssemblyFile="$(MonoAOTCompilerTasksAssemblyPath)" />
-</Project>
--- /dev/null
+<Project>
+ <PropertyGroup>
+ <MonoAOTCompilerTasksAssemblyPath Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tasks\${TargetFrameworkForNETCoreTasks}\MonoAOTCompiler.dll</MonoAOTCompilerTasksAssemblyPath>
+ <MonoAOTCompilerTasksAssemblyPath Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tasks\${TargetFrameworkForNETFrameworkTasks}\MonoAOTCompiler.dll</MonoAOTCompilerTasksAssemblyPath>
+ </PropertyGroup>
+ <UsingTask TaskName="MonoAOTCompiler" AssemblyFile="$(MonoAOTCompilerTasksAssemblyPath)" />
+</Project>
<PackageFile Include="Sdk\Sdk.props" TargetPath="Sdk" />
<PackageFile Include="Sdk\Sdk.targets" TargetPath="Sdk" />
<PackageFile Include="build\$(MSBuildProjectName).props" TargetPath="build" />
- <PackageFile Include="Sdk\MonoTargetsTasks.props" TargetPath="Sdk" />
<PackageFile Include="Sdk\RuntimeComponentManifest.targets" TargetPath="Sdk" />
</ItemGroup>
+ <Target Name="_PrepareForPack" BeforeTargets="GetPackageFiles">
+ <PropertyGroup>
+ <MonoTargetsTasksPropsPath>$(IntermediateOutputPath)MonoTargetsTasks.props</MonoTargetsTasksPropsPath>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <_ReplacementValue Include="TargetFrameworkForNETCoreTasks" Value="$(TargetFrameworkForNETCoreTasks)" />
+ <_ReplacementValue Include="TargetFrameworkForNETFrameworkTasks" Value="$(TargetFrameworkForNETFrameworkTasks)" />
+ </ItemGroup>
+
+ <GenerateFileFromTemplate
+ TemplateFile="Sdk/MonoTargetsTasks.props.in"
+ Properties="@(_ReplacementValue)"
+ OutputPath="$(MonoTargetsTasksPropsPath)" />
+
+ <ItemGroup>
+ <PackageFile Include="$(MonoTargetsTasksPropsPath)" TargetPath="Sdk" />
+ </ItemGroup>
+ </Target>
+
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
</Project>
<Project>
<PropertyGroup>
- <MonoTargetsTasksAssemblyPath Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tasks\net6.0\MonoTargetsTasks.dll</MonoTargetsTasksAssemblyPath>
- <MonoTargetsTasksAssemblyPath Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tasks\net472\MonoTargetsTasks.dll</MonoTargetsTasksAssemblyPath>
+ <MonoTargetsTasksAssemblyPath Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tasks\${TargetFrameworkForNETCoreTasks}\MonoTargetsTasks.dll</MonoTargetsTasksAssemblyPath>
+ <MonoTargetsTasksAssemblyPath Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tasks\${TargetFrameworkForNETFrameworkTasks}\MonoTargetsTasks.dll</MonoTargetsTasksAssemblyPath>
</PropertyGroup>
<!-- ILStrip -->
<UsingTask TaskName="ILStrip" AssemblyFile="$(MonoTargetsTasksAssemblyPath)" />
<ProjectReference Include="$(RepoTasksDir)WasmAppBuilder\WasmAppBuilder.csproj" />
<ProjectReference Include="$(RepoTasksDir)WasmBuildTasks\WasmBuildTasks.csproj" />
- <PackageFile Include="Sdk\Sdk.targets" TargetPath="Sdk" />
<PackageFile Include="Sdk\AutoImport.props" TargetPath="Sdk" />
<PackageFile Include="$(RepoRoot)\src\mono\wasm\build\WasmApp.props" TargetPath="Sdk" />
<PackageFile Include="$(RepoRoot)\src\mono\wasm\build\WasmApp.targets" TargetPath="Sdk" />
<PackageFile Include="$(RepoRoot)\src\mono\wasm\build\EmSdkRepo.Defaults.props" TargetPath="Sdk" />
</ItemGroup>
+ <Target Name="_PrepareForPack" BeforeTargets="GetPackageFiles">
+ <PropertyGroup>
+ <SdkTargetsPath>$(IntermediateOutputPath)Sdk.targets</SdkTargetsPath>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <_ReplacementValue Include="TargetFrameworkForNETCoreTasks" Value="$(TargetFrameworkForNETCoreTasks)" />
+ <_ReplacementValue Include="TargetFrameworkForNETFrameworkTasks" Value="$(TargetFrameworkForNETFrameworkTasks)" />
+ </ItemGroup>
+
+ <GenerateFileFromTemplate
+ TemplateFile="Sdk/Sdk.targets.in"
+ Properties="@(_ReplacementValue)"
+ OutputPath="$(SdkTargetsPath)" />
+
+ <ItemGroup>
+ <PackageFile Include="$(SdkTargetsPath)" TargetPath="Sdk" />
+ </ItemGroup>
+ </Target>
+
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
</Project>
<Project>
<!-- Property overrides -->
<PropertyGroup>
- <_TasksDir Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tasks\net6.0\</_TasksDir>
- <_TasksDir Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tasks\net472\</_TasksDir>
+ <_TasksDir Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tasks\${TargetFrameworkForNETCoreTasks}\</_TasksDir>
+ <_TasksDir Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tasks\${TargetFrameworkForNETFrameworkTasks}\</_TasksDir>
<WasmAppBuilderTasksAssemblyPath>$(_TasksDir)WasmAppBuilder.dll</WasmAppBuilderTasksAssemblyPath>
<WasmBuildTasksAssemblyPath>$(_TasksDir)WasmBuildTasks.dll</WasmBuildTasksAssemblyPath>
<PropertyGroup>
<Platform>AnyCPU</Platform>
<EnableTargetingPackDownload>false</EnableTargetingPackDownload>
- <TargetFramework>$(NetCoreAppToolCurrent)</TargetFramework>
+ <TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<EMSDK_PATH Condition="'$(EMSDK_PATH)' == '' and '$(MonoProjectRoot)' != ''">$([MSBuild]::NormalizeDirectory($(MonoProjectRoot), 'wasm', 'emsdk'))</EMSDK_PATH>
<RunAOTCompilation Condition="'$(RunAOTCompilation)' == ''">false</RunAOTCompilation>
<PublishTrimmed>true</PublishTrimmed>
<Description>Templates to create WebAssembly projects.</Description>
<PackageTags>dotnet-new;templates</PackageTags>
- <TargetFramework>net6.0</TargetFramework>
+ <TargetFramework>$(NetCoreAppToolCurrent)</TargetFramework>
<IncludeContentInPack>true</IncludeContentInPack>
<IncludeBuildOutput>false</IncludeBuildOutput>
+++ /dev/null
-<Project>
- <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props, '$(MSBuildThisFileDirectory)..'))" />
-
- <PropertyGroup>
- <TargetFrameworkForNETFrameworkTasks>net472</TargetFrameworkForNETFrameworkTasks>
- <!-- Don't build for NETFramework during source-build. -->
- <TargetFrameworkForNETFrameworkTasks Condition="'$(DotNetBuildFromSource)' == 'true'" />
-
- <TargetFrameworkForNETCoreTasks>net6.0</TargetFrameworkForNETCoreTasks>
- </PropertyGroup>
-</Project>
}
// .NET 6 implements this method directly on Socket, but for earlier runtimes we need a polyfill
-#if !NET6_0
+#if !NET6_0_OR_GREATER
public async Task<Socket> AcceptAsync(CancellationToken token)
{
using (token.Register(() => Close(0)))
}
// .NET 6 implements this method directly on Socket, but for earlier runtimes we need a polyfill
-#if !NET6_0
+#if !NET6_0_OR_GREATER
public async Task ConnectAsync(EndPoint remoteEP, CancellationToken token)
{
using (token.Register(() => Close(0)))