Skip to content

Commit

Permalink
Log explicit failure for LC on Core
Browse files Browse the repository at this point in the history
This isn't going to be supported per dotnet/winforms#1462.
  • Loading branch information
rainersigwald committed Nov 23, 2021
1 parent 4d3ff70 commit 9ea7f9e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
15 changes: 15 additions & 0 deletions src/Tasks/LC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,21 @@ public string SdkToolsPath
public string TargetFrameworkVersion { get; set; }
#endregion

#if !NETFRAMEWORK
/// <summary>
/// Override of Execute that errors, since <see cref="LC"/> is not expected to get
/// .NET Core support.
/// </summary>
/// <remarks>
/// See https://github.com/dotnet/winforms/issues/1462.
/// </remarks>
public override bool Execute()
{
Log.LogErrorFromResources("TaskRequiresFrameworkFailure", nameof(LC));
return false;
}
#endif

#region Class properties

/// <summary>
Expand Down
8 changes: 4 additions & 4 deletions src/Tasks/Microsoft.Build.Tasks.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\Shared\FileSystemSources.proj" />
<Import Project="..\Shared\DebuggingSources.proj" />
Expand Down Expand Up @@ -463,6 +463,9 @@
<Compile Include="InvalidParameterValueException.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="LC.cs" Condition="'$(MonoBuild)' != 'true'">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="ListOperators\FindUnderPath.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
Expand Down Expand Up @@ -622,9 +625,6 @@
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="RCWForCurrentContext.cs" />
<Compile Include="LC.cs" Condition="'$(MonoBuild)' != 'true'">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="PiaReference.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
Expand Down
1 change: 1 addition & 0 deletions src/Tasks/PublicAPI/netstandard/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
override Microsoft.Build.Tasks.LC.Execute() -> bool

0 comments on commit 9ea7f9e

Please sign in to comment.