Skip to content

Commit 56d2884

Browse files
Disable CA2022 errors (#4961)
1 parent 1cd0d89 commit 56d2884

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Microsoft.TestPlatform.CoreUtilities/Helpers/DotnetHostHelper.cs

+2
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,10 @@ public bool TryGetDotnetPathByArchitecture(
409409
using var headerReader = _fileHelper.GetStream(path, FileMode.Open, FileAccess.Read);
410410
var magicBytes = new byte[4];
411411
var cpuInfoBytes = new byte[4];
412+
#pragma warning disable CA2022 // Avoid inexact read
412413
headerReader.Read(magicBytes, 0, magicBytes.Length);
413414
headerReader.Read(cpuInfoBytes, 0, cpuInfoBytes.Length);
415+
#pragma warning restore CA2022
414416

415417
var magic = BitConverter.ToUInt32(magicBytes, 0);
416418
var cpuInfo = BitConverter.ToUInt32(cpuInfoBytes, 0);

0 commit comments

Comments
 (0)