Browse Source

所有项目升级到.net6

陈国伟 4 năm trước cách đây
mục cha
commit
7612e38600

+ 1 - 0
Directory.Build.props

@@ -5,6 +5,7 @@
 		<Description>github加速神器</Description>
 		<Copyright>https://github.com/xljiulang/FastGithub</Copyright>
 		<RuntimeIdentifier>win-x64</RuntimeIdentifier>
+		<TargetFramework>net6.0</TargetFramework>
 	</PropertyGroup>
 
 	<PropertyGroup Condition="'$(Configuration)'=='Release'">

+ 3 - 4
FastGithub.Core/FastGithub.Core.csproj

@@ -1,13 +1,12 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<TargetFramework>net5.0</TargetFramework>
+	<PropertyGroup> 
 		<RootNamespace>FastGithub</RootNamespace>
 	</PropertyGroup>
 
 	<ItemGroup> 
-	  <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" /> 
-	  <PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0" />
+	  <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0-*" /> 
+	  <PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0-*" />
 	</ItemGroup>  
   
 </Project>

+ 2 - 3
FastGithub.Dns/FastGithub.Dns.csproj

@@ -1,13 +1,12 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<TargetFramework>net5.0</TargetFramework>
+	<PropertyGroup> 
 		<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
 	</PropertyGroup>
 
 	<ItemGroup>
 		<PackageReference Include="DNS" Version="6.1.0" />
-		<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0-*" />
 	</ItemGroup>
 
 	<ItemGroup>

+ 21 - 25
FastGithub.DomainResolve/FastGithub.DomainResolve.csproj

@@ -1,31 +1,27 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<TargetFramework>net5.0</TargetFramework>
-	</PropertyGroup>
+  <ItemGroup>
+    <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="6.0.0-*" />
+    <PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0-*" />
+    <PackageReference Include="DNS" Version="6.1.0" />
+    <ProjectReference Include="..\FastGithub.Core\FastGithub.Core.csproj" />
+  </ItemGroup>
 
-	<ItemGroup>
-		<PackageReference Include="DNS" Version="6.1.0" />
-		<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
-		<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
-		<ProjectReference Include="..\FastGithub.Core\FastGithub.Core.csproj" />
-	</ItemGroup>
+  <ItemGroup>
+    <None Update="dnscrypt-proxy.toml">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
 
-	<ItemGroup>
-		<None Update="dnscrypt-proxy.toml">
-			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-		</None>
-	</ItemGroup>
+  <ItemGroup Condition="'$(RuntimeIdentifier)' == 'win-x64'">
+    <None Update="dnscrypt-proxy.exe">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
 
-	<ItemGroup Condition="'$(RuntimeIdentifier)' == 'win-x64'">
-		<None Update="dnscrypt-proxy.exe">
-			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-		</None>
-	</ItemGroup>
-
-	<ItemGroup Condition="'$(RuntimeIdentifier)' == 'linux-x64'">
-		<None Update="dnscrypt-proxy">
-			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-		</None>
-	</ItemGroup>
+  <ItemGroup Condition="'$(RuntimeIdentifier)' == 'linux-x64'">
+    <None Update="dnscrypt-proxy">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
 </Project>

+ 1 - 5
FastGithub.Http/FastGithub.Http.csproj

@@ -1,8 +1,4 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
-	<PropertyGroup>
-		<TargetFramework>net5.0</TargetFramework>
-	</PropertyGroup>
+<Project Sdk="Microsoft.NET.Sdk"> 
 
 	<ItemGroup>
 		<PackageReference Include="Portable.BouncyCastle" Version="1.8.10" />

+ 1 - 2
FastGithub.ReverseProxy/FastGithub.ReverseProxy.csproj

@@ -1,7 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<TargetFramework>net5.0</TargetFramework>
+	<PropertyGroup> 
 		<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
 	</PropertyGroup>
 

+ 2 - 2
FastGithub.ReverseProxy/KestrelServerOptionsExtensions.cs

@@ -108,9 +108,9 @@ namespace FastGithub
         /// <param name="caPublicCerPath"></param>
         /// <param name="caPrivateKeyPath"></param>
         /// <returns></returns>
-        private static X509Certificate2 GetDomainCert(string domain, string caPublicCerPath, string caPrivateKeyPath)
+        private static X509Certificate2 GetDomainCert(string? domain, string caPublicCerPath, string caPrivateKeyPath)
         {
-            return domainCerts.GetOrAdd(domain, GetOrCreateCert).Value;
+            return domainCerts.GetOrAdd(domain ?? string.Empty, GetOrCreateCert).Value;
 
             Lazy<X509Certificate2> GetOrCreateCert(string host)
             {

+ 2 - 6
FastGithub.Upgrade/FastGithub.Upgrade.csproj

@@ -1,11 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
-
-  <PropertyGroup>
-    <TargetFramework>net5.0</TargetFramework>
-  </PropertyGroup>
-
+ 
   <ItemGroup>
-    <PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0-*" />
   </ItemGroup>
 
   <ItemGroup>

+ 0 - 0
FastGithub/zip.sh → FastGithub/pack.sh


+ 2 - 2
FastGithub/publish.cmd

@@ -1,2 +1,2 @@
-dotnet publish -c Release -f net6.0 /p:PublishSingleFile=true /p:PublishTrimmed=true -r win-x64 -o ./bin/publish/win-x64
-dotnet publish -c Release -f net6.0 /p:PublishSingleFile=true /p:PublishTrimmed=true -r linux-x64 -o ./bin/publish/linux-x64
+dotnet publish -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true -r win-x64 -o ./bin/publish/win-x64
+dotnet publish -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true -r linux-x64 -o ./bin/publish/linux-x64