Skip to content

Commit

Permalink
Upgrade to .net 9, C# 13
Browse files Browse the repository at this point in the history
  • Loading branch information
veniware committed Nov 14, 2024
1 parent e3d11d8 commit b316d38
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 17 deletions.
4 changes: 2 additions & 2 deletions Protest-CacheGenerator/Protest-CacheGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" />
</ItemGroup>

</Project>
18 changes: 12 additions & 6 deletions Protest-Tests/Protest-Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand All @@ -22,11 +22,17 @@
<ItemGroup>
<ProjectReference Include="..\Protest\Protest.csproj" />

<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="NUnit.Analyzers" Version="3.3.0" />
<PackageReference Include="coverlet.collector" Version="3.1.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.4.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

</ItemGroup>

Expand Down
12 changes: 6 additions & 6 deletions Protest/Protest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>13</LangVersion>
<Platforms>x64</Platforms>
<PlatformTarget>x64</PlatformTarget>

Expand Down Expand Up @@ -47,11 +47,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.DirectoryServices" Version="8.0.0" />
<PackageReference Include="System.Management" Version="8.0.0" />
<PackageReference Include="System.DirectoryServices" Version="9.0.0" />
<PackageReference Include="System.Management" Version="9.0.0" />
<PackageReference Include="Yarp.ReverseProxy" Version="2.2.0" />
<PackageReference Include="SSH.NET" Version="2024.1.0" />
<PackageReference Include="Lextm.SharpSnmpLib" Version="12.5.3" />
<PackageReference Include="SSH.NET" Version="2024.2.0" />
<PackageReference Include="Lextm.SharpSnmpLib" Version="12.5.5" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'RELEASE'">
Expand Down
4 changes: 2 additions & 2 deletions Protest/Protocols/Dns.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,12 @@ public static byte[] Resolve(
secureStream.Flush();

byte[] responseLengthBytes = new byte[2];
secureStream.Read(responseLengthBytes, 0, 2);
secureStream.ReadExactly(responseLengthBytes, 0, 2);
if (BitConverter.IsLittleEndian) Array.Reverse(responseLengthBytes);

short responseLength = BitConverter.ToInt16(responseLengthBytes, 0);
response = new byte[responseLength];
secureStream.Read(response, 0, responseLength);
secureStream.ReadExactly(response, 0, responseLength);

secureStream.Close();
socket.Close();
Expand Down
5 changes: 4 additions & 1 deletion Protest/Tasks/Import.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ public static byte[] ImportTask(Dictionary<string, string> parameters, string or

Uri uri = new Uri($"{protocol}://{ip}:{port}");

ServicePointManager.ServerCertificateValidationCallback = (message, cert, chain, errors) => { return true; };
//TODO:
#pragma warning disable SYSLIB0014
ServicePointManager.ServerCertificateValidationCallback = (message, cert, chain, errors) => true;
#pragma warning restore SYSLIB0014

try {
using HttpClient versionClient = new HttpClient();
Expand Down

0 comments on commit b316d38

Please sign in to comment.