Minor tweaks to reduce warnings

This commit is contained in:
Matt Nadareski
2023-11-14 23:48:35 -05:00
parent 6bcdc0e3c6
commit 580db0cb65
3 changed files with 4 additions and 4 deletions

View File

@@ -7,6 +7,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<!-- <TreatWarningsAsErrors>true</TreatWarningsAsErrors> --> <!-- Can't be enabled because of external code -->
<Version>3.0.0</Version>

View File

@@ -236,10 +236,8 @@ namespace BinaryObjectScanner
// Open the file and begin scanning
try
{
using (FileStream fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read))
{
return GetInternalProtections(file, fs);
}
using FileStream fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read);
return GetInternalProtections(file, fs);
}
catch (Exception ex)
{

View File

@@ -4,6 +4,7 @@
<TargetFrameworks>net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
<OutputType>Exe</OutputType>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
</PropertyGroup>
<ItemGroup>