Skip to content

Commit 0541e6f

Browse files
authored
Fix warnings shown in VMR with recent SDK
Observed in dotnet/sdk#48436 Fixes IDE0040, IDE0350, IDE0052 and IDE0051
1 parent e0de5c8 commit 0541e6f

File tree

5 files changed

+5
-15
lines changed

5 files changed

+5
-15
lines changed

src/Framework/BinaryTranslator.cs

-12
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,6 @@ internal static ITranslator GetWriteTranslator(Stream stream)
5555
/// </summary>
5656
private class BinaryReadTranslator : ITranslator
5757
{
58-
/// <summary>
59-
/// The stream used as a source or destination for data.
60-
/// </summary>
61-
private Stream _packetStream;
62-
6358
/// <summary>
6459
/// The binary reader used in read mode.
6560
/// </summary>
@@ -71,7 +66,6 @@ private class BinaryReadTranslator : ITranslator
7166
/// </summary>
7267
public BinaryReadTranslator(Stream packetStream, BinaryReaderFactory buffer)
7368
{
74-
_packetStream = packetStream;
7569
_reader = buffer.Create(packetStream);
7670
}
7771
#nullable disable
@@ -795,11 +789,6 @@ public bool TranslateNullable<T>(T value)
795789
/// </summary>
796790
private class BinaryWriteTranslator : ITranslator
797791
{
798-
/// <summary>
799-
/// The stream used as a source or destination for data.
800-
/// </summary>
801-
private Stream _packetStream;
802-
803792
/// <summary>
804793
/// The binary writer used in write mode.
805794
/// </summary>
@@ -811,7 +800,6 @@ private class BinaryWriteTranslator : ITranslator
811800
/// <param name="packetStream">The stream serving as the source or destination of data.</param>
812801
public BinaryWriteTranslator(Stream packetStream)
813802
{
814-
_packetStream = packetStream;
815803
_writer = new BinaryWriter(packetStream);
816804
}
817805

src/Framework/BuildEventArgs.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ private void SetBuildEventContextDefaultAfterSerialization(StreamingContext sc)
284284
/// This is used by the Message property overrides to reconstruct the
285285
/// message lazily on demand.
286286
/// </summary>
287-
internal static Func<string, string?[], string> ResourceStringFormatter = (string resourceName, string?[] arguments) =>
287+
internal static Func<string, string?[], string> ResourceStringFormatter = (resourceName, arguments) =>
288288
{
289289
var sb = new StringBuilder();
290290
sb.Append(resourceName);

src/Framework/IBuildEngine7.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ namespace Microsoft.Build.Framework
1111
/// </summary>
1212
public interface IBuildEngine7 : IBuildEngine6
1313
{
14-
public bool AllowFailureWithoutError { get; set; }
14+
bool AllowFailureWithoutError { get; set; }
1515
}
1616
}

src/Framework/IBuildEngine8.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ public interface IBuildEngine8 : IBuildEngine7
1717
/// </summary>
1818
/// <param name="warningCode">The warning code to check.</param>
1919
/// <returns>A boolean to determine whether the warning should be treated as an error.</returns>
20-
public bool ShouldTreatWarningAsError(string warningCode);
20+
bool ShouldTreatWarningAsError(string warningCode);
2121
}
2222
}

src/Framework/InternalErrorException.cs

+2
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ private static void LaunchDebugger(string message, string innerMessage)
148148
}
149149
#endregion
150150

151+
#if DEBUG
151152
private static bool RunningTests() => BuildEnvironmentState.s_runningTests;
153+
#endif
152154
}
153155
}

0 commit comments

Comments
 (0)