Skip to content

Commit 3f93063

Browse files
committed
fix: oss sample error
1 parent 9ec0171 commit 3f93063

File tree

21 files changed

+128
-232
lines changed

21 files changed

+128
-232
lines changed

src/OSS/OSSClientSample/.idea/.idea.OSSClientSample/.idea/.gitignore

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/OSS/OSSClientSample/OSSClientSample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net9.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
</PropertyGroup>
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OSSClientSample", "OSSClientSample.csproj", "{2892673E-5A89-4523-8005-F11DB3C96E40}"
3+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OSSClientSample", "OSSClientSample.csproj", "{AAA0E4B3-4807-43B8-8DB6-8EA6AA57A53F}"
44
EndProject
55
Global
66
GlobalSection(SolutionConfigurationPlatforms) = preSolution
77
Debug|Any CPU = Debug|Any CPU
88
Release|Any CPU = Release|Any CPU
99
EndGlobalSection
1010
GlobalSection(ProjectConfigurationPlatforms) = postSolution
11-
{2892673E-5A89-4523-8005-F11DB3C96E40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
12-
{2892673E-5A89-4523-8005-F11DB3C96E40}.Debug|Any CPU.Build.0 = Debug|Any CPU
13-
{2892673E-5A89-4523-8005-F11DB3C96E40}.Release|Any CPU.ActiveCfg = Release|Any CPU
14-
{2892673E-5A89-4523-8005-F11DB3C96E40}.Release|Any CPU.Build.0 = Release|Any CPU
11+
{AAA0E4B3-4807-43B8-8DB6-8EA6AA57A53F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
12+
{AAA0E4B3-4807-43B8-8DB6-8EA6AA57A53F}.Debug|Any CPU.Build.0 = Debug|Any CPU
13+
{AAA0E4B3-4807-43B8-8DB6-8EA6AA57A53F}.Release|Any CPU.ActiveCfg = Release|Any CPU
14+
{AAA0E4B3-4807-43B8-8DB6-8EA6AA57A53F}.Release|Any CPU.Build.0 = Release|Any CPU
1515
EndGlobalSection
1616
EndGlobal

src/OSS/OSSClientSample/Program.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
using GeneralUpdate.ClientCore;
33
using GeneralUpdate.Common.Shared.Object;
44

5-
var paramsOSS = new GlobalConfigInfoOSS();
6-
paramsOSS.Url = "http://192.168.50.203/versions.json";
7-
paramsOSS.CurrentVersion = "1.0.0.0";
8-
paramsOSS.VersionFileName = "versions.json";
9-
paramsOSS.AppName = "GeneralUpdate.Client.exe";
10-
paramsOSS.Encoding = Encoding.UTF8.WebName;
11-
GeneralClientOSS.Start(paramsOSS);
5+
var paramsOSS = new GlobalConfigInfoOSS
6+
{
7+
Url = "http://localhost:5000/packages/versions.json",
8+
CurrentVersion = "1.0.0.0",
9+
VersionFileName = "versions.json",
10+
AppName = "OSSClientSample.exe",
11+
Encoding = Encoding.UTF8.WebName
12+
};
13+
14+
await GeneralClientOSS.Start(paramsOSS, "OSSUpgradeSample.exe");
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@echo off
22
REM 设置解决方案文件路径
3-
set SOLUTION_PATH=StartManager.sln
3+
set SOLUTION_PATH=OSSClientSample.sln
44

55
REM 切换到解决方案所在的目录
66
cd /d %~dp0

src/OSS/OSSUpgradeSample/OSSUpgradeSample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net9.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
</PropertyGroup>

src/OSS/OSSUpgradeSample/Program.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,11 @@
88
*
99
* Typically, GeneralClientOSS and GeneralUpdateOSS appear as a pair.
1010
*/
11-
GeneralUpdateOSS.Start();
11+
try
12+
{
13+
await GeneralUpdateOSS.Start();
14+
}
15+
catch (Exception ex)
16+
{
17+
Console.WriteLine(ex.Message);
18+
}

src/OSS/OSSUpgradeSample/build.bat

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@echo off
2+
REM 设置解决方案文件路径
3+
set SOLUTION_PATH=OSSUpgradeSample.sln
4+
5+
REM 切换到解决方案所在的目录
6+
cd /d %~dp0
7+
8+
REM 运行dotnet build命令
9+
dotnet build %SOLUTION_PATH% -c Release
10+
11+
REM 检查构建是否成功
12+
if %errorlevel% neq 0 (
13+
echo Build failed
14+
) else (
15+
echo Build succeeded
16+
)

src/Server/ServerSample.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88

99
<ItemGroup>
1010
<Content Remove="ServerSample\**" />
11+
<Content Update="wwwroot\packages\versions.json">
12+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
13+
</Content>
14+
<Content Update="wwwroot\packages\packet_20250102230201638_1.0.0.1.zip">
15+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
16+
</Content>
1117
</ItemGroup>
1218

1319
<ItemGroup>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[
2+
{
3+
"PacketName": "packet_20250102230201638_1.0.0.1",
4+
"Hash": "ad1a85a9169ca0083ab54ba390e085c56b9059efc3ca8aa1ec9ed857683cc4b1",
5+
"Version": "1.0.0.1",
6+
"Url": "http://localhost:5000/packages/packet_20250102230201638_1.0.0.1.zip",
7+
"PubTime": "2025-01-02T23:48:21"
8+
}
9+
]

0 commit comments

Comments
 (0)