优化各项目版本设置
This commit is contained in:
parent
41429ed929
commit
1c342d1e35
|
@ -2,14 +2,14 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFrameworks>net5.0;netcoreapp3.1;net45;net40;net6.0</TargetFrameworks>
|
||||
<TargetFrameworks>net40;net45;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
|
||||
<AssemblyTitle>星尘代理</AssemblyTitle>
|
||||
<Description>星尘,分布式资源调度,客户端代理部署于每一台机器节点,接受服务端命令,获取目标应用包并拉起进程。</Description>
|
||||
<Description>星尘,分布式资源调度,部署于每一个节点,连接服务端,支持节点监控、远程发布。</Description>
|
||||
<Company>新生命开发团队</Company>
|
||||
<Copyright>©2002-2021 NewLife</Copyright>
|
||||
<Version>1.1.2021.1114</Version>
|
||||
<FileVersion>1.1.2021.1114</FileVersion>
|
||||
<AssemblyVersion>1.0.*</AssemblyVersion>
|
||||
<Version>1.1.2021.1118</Version>
|
||||
<FileVersion>1.1.2021.1118</FileVersion>
|
||||
<AssemblyVersion>1.1.*</AssemblyVersion>
|
||||
<Deterministic>false</Deterministic>
|
||||
<OutputPath>..\Bin\Agent</OutputPath>
|
||||
<!--<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>-->
|
||||
|
@ -23,14 +23,6 @@
|
|||
<ItemGroup>
|
||||
<RuntimeHostConfigurationOption Include="System.Globalization.Invariant" Value="true" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)'=='netcoreapp3.1'">
|
||||
<DefineConstants>$(DefineConstants);__CORE__</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)'=='net45'">
|
||||
<DefineConstants>$(DefineConstants);__WIN__</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
|
||||
<DefineConstants>$(DefineConstants);DEBUG</DefineConstants>
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
|
||||
<AssemblyName>staragent</AssemblyName>
|
||||
<AssemblyTitle>星尘代理</AssemblyTitle>
|
||||
<Description>星尘,分布式资源调度,客户端代理部署于每一台机器节点,接受服务端命令,获取目标应用包并拉起进程。</Description>
|
||||
<Description>星尘,分布式资源调度,部署于每一个节点,连接服务端,支持节点监控、远程发布。</Description>
|
||||
<Company>新生命开发团队</Company>
|
||||
<Copyright>©2002-2020 NewLife</Copyright>
|
||||
<Version>1.0.2020.1201</Version>
|
||||
<FileVersion>1.0.2020.1201</FileVersion>
|
||||
<AssemblyVersion>1.0.*</AssemblyVersion>
|
||||
<Version>1.1.2021.1118</Version>
|
||||
<FileVersion>1.1.2021.1118</FileVersion>
|
||||
<AssemblyVersion>1.1.*</AssemblyVersion>
|
||||
<Deterministic>false</Deterministic>
|
||||
<OutputPath>..\Bin\AgentTool</OutputPath>
|
||||
<!--<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>-->
|
||||
|
@ -39,10 +39,6 @@
|
|||
<ItemGroup>
|
||||
<RuntimeHostConfigurationOption Include="System.Globalization.Invariant" Value="true" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)'=='netcoreapp3.1'">
|
||||
<DefineConstants>$(DefineConstants);__CORE__</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
|
||||
<DefineConstants>$(DefineConstants);DEBUG</DefineConstants>
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AssemblyTitle>星尘网关</AssemblyTitle>
|
||||
<Description>星尘网关,转发网络请求,实现路由切换。</Description>
|
||||
<Company>新生命开发团队</Company>
|
||||
<Copyright>©2002-2020 NewLife</Copyright>
|
||||
<Version>1.0.2020.1201</Version>
|
||||
<FileVersion>1.0.2020.1201</FileVersion>
|
||||
<AssemblyVersion>1.0.*</AssemblyVersion>
|
||||
<Version>1.1.2021.1118</Version>
|
||||
<FileVersion>1.1.2021.1118</FileVersion>
|
||||
<AssemblyVersion>1.1.*</AssemblyVersion>
|
||||
<Deterministic>false</Deterministic>
|
||||
<OutputPath>..\Bin\Gateway</OutputPath>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
<OutputType>Library</OutputType>
|
||||
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
|
||||
<AssemblyTitle>星尘分布式服务框架</AssemblyTitle>
|
||||
<Description>星尘,分布式服务框架。分布式资源调度,服务自动注册和发现,负载均衡,动态伸缩,故障转移,性能监控。</Description>
|
||||
<Description>星尘,分布式服务框架。节点管理,监控中心,配置中心,发布中心,注册中心</Description>
|
||||
<Company>新生命开发团队</Company>
|
||||
<Copyright>©2002-2021 NewLife</Copyright>
|
||||
<Version>1.5.2021.1109</Version>
|
||||
<FileVersion>1.5.2021.1109</FileVersion>
|
||||
<Version>1.5.2021.1118</Version>
|
||||
<FileVersion>1.5.2021.1118</FileVersion>
|
||||
<AssemblyVersion>1.5.*</AssemblyVersion>
|
||||
<Deterministic>false</Deterministic>
|
||||
<OutputPath>..\..\Bin</OutputPath>
|
||||
|
@ -34,18 +34,6 @@
|
|||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
|
||||
<DefineConstants>$(DefineConstants);NETSTANDARD2_0;__CORE__</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(TargetFramework)'=='net5.0'">
|
||||
<DefineConstants>$(DefineConstants);NET50;__CORE__</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(TargetFramework)'=='net40'">
|
||||
<DefineConstants>$(DefineConstants);__WIN__;NET4</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(TargetFramework)'=='net45'">
|
||||
<DefineConstants>$(DefineConstants);__WIN__;NET45</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Remove="StarService.cs" />
|
||||
</ItemGroup>
|
||||
|
@ -53,19 +41,7 @@
|
|||
<ItemGroup>
|
||||
<Content Include="..\Doc\leaf.png" Link="leaf.png" PackagePath="\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions">
|
||||
<Version>5.0.0</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions">
|
||||
<Version>5.0.0</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Hosting.Server.Abstractions" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.0" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AssemblyName>StarServer</AssemblyName>
|
||||
<AssemblyTitle>星尘服务平台</AssemblyTitle>
|
||||
<Description>星尘,分布式服务框架。分布式资源调度,服务自动注册和发现,负载均衡,动态伸缩,故障转移,性能监控。</Description>
|
||||
<Description>星尘,分布式服务框架。节点管理,监控中心,配置中心,发布中心,注册中心</Description>
|
||||
<Company>新生命开发团队</Company>
|
||||
<Copyright>©2002-2021 NewLife</Copyright>
|
||||
<Version>1.1.2021.1031</Version>
|
||||
<FileVersion>1.1.2021.1031</FileVersion>
|
||||
<Version>1.1.2021.1118</Version>
|
||||
<FileVersion>1.1.2021.1118</FileVersion>
|
||||
<AssemblyVersion>1.1.*</AssemblyVersion>
|
||||
<Deterministic>false</Deterministic>
|
||||
<OutputPath>..\Bin\Server</OutputPath>
|
||||
|
@ -20,14 +20,6 @@
|
|||
<UserSecretsId>377ee3b4-0b0b-46ea-9059-cca0d3fa451e</UserSecretsId>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)'=='netcoreapp2.1'">
|
||||
<DefineConstants>$(DefineConstants);NETSTANDARD2_0</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)'=='net45'">
|
||||
<DefineConstants>$(DefineConstants);__WIN__</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
|
||||
<DefineConstants>$(DefineConstants);DEBUG</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
|
@ -49,7 +41,6 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NewLife.Redis" Version="3.9.2021.1001" />
|
||||
<PackageReference Include="NewLife.XCode" Version="10.3.2021.1109" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -4,10 +4,11 @@
|
|||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AssemblyName>StarWeb</AssemblyName>
|
||||
<AssemblyTitle>星尘管理平台</AssemblyTitle>
|
||||
<Description>星尘,分布式服务框架。节点管理,监控中心,配置中心,发布中心,注册中心</Description>
|
||||
<Company>新生命开发团队</Company>
|
||||
<Copyright>©2002-2021 NewLife</Copyright>
|
||||
<Version>1.1.2021.1031</Version>
|
||||
<FileVersion>1.1.2021.1031</FileVersion>
|
||||
<Version>1.1.2021.1118</Version>
|
||||
<FileVersion>1.1.2021.1118</FileVersion>
|
||||
<AssemblyVersion>1.1.*</AssemblyVersion>
|
||||
<Deterministic>false</Deterministic>
|
||||
<OutputPath>..\Bin\Web</OutputPath>
|
||||
|
@ -46,10 +47,8 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NewLife.Core" Version="8.11.2021.1109" />
|
||||
<PackageReference Include="NewLife.Cube.Core" Version="4.1.2021.1109" />
|
||||
<PackageReference Include="NewLife.Redis" Version="3.9.2021.1001" />
|
||||
<PackageReference Include="NewLife.XCode" Version="10.3.2021.1109" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -12,7 +12,7 @@ using NewLife.Net;
|
|||
using NewLife.Reflection;
|
||||
using NewLife.Remoting;
|
||||
using Stardust.Models;
|
||||
#if !NET4
|
||||
#if !NET40
|
||||
using TaskEx = System.Threading.Tasks.Task;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#if NET50
|
||||
#if NET5_0_OR_GREATER
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#if NET50
|
||||
#if NET5_0_OR_GREATER
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
|
|
@ -262,7 +262,7 @@ namespace Stardust.Monitors
|
|||
DefaultTracer.Instance = this;
|
||||
ApiHelper.Tracer = this;
|
||||
|
||||
#if NET50
|
||||
#if NET5_0_OR_GREATER
|
||||
// 订阅Http事件
|
||||
var observer = new DiagnosticListenerObserver { Tracer = this };
|
||||
observer.Subscribe(new HttpDiagnosticListener());
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
using System.IO;
|
||||
using NewLife.Log;
|
||||
using Stardust.Models;
|
||||
#if !__CORE__
|
||||
#if NET40_OR_GREATER
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Windows.Forms;
|
||||
|
@ -22,7 +22,7 @@ namespace Stardust.Services
|
|||
|
||||
private Byte[] DoCapture(CommandModel command)
|
||||
{
|
||||
#if !__CORE__
|
||||
#if NET40_OR_GREATER
|
||||
if (command.Expire.Year < 2000 || command.Expire > DateTime.Now)
|
||||
{
|
||||
return GetScreenCapture();
|
||||
|
@ -42,7 +42,7 @@ namespace Stardust.Services
|
|||
return null;
|
||||
}
|
||||
|
||||
#if !__CORE__
|
||||
#if NET40_OR_GREATER
|
||||
private Byte[] GetScreenCapture()
|
||||
{
|
||||
// 获取dpi,需要 app.manifest 打开感知dpi
|
||||
|
|
|
@ -21,7 +21,7 @@ using NewLife.Threading;
|
|||
using Stardust.Models;
|
||||
using Stardust.Services;
|
||||
using System.Runtime.InteropServices;
|
||||
#if !NET4
|
||||
#if !NET40
|
||||
using System.Net.WebSockets;
|
||||
using WebSocket = System.Net.WebSockets.WebSocket;
|
||||
#endif
|
||||
|
@ -219,9 +219,7 @@ namespace Stardust
|
|||
Time = DateTime.UtcNow,
|
||||
};
|
||||
|
||||
#if __CORE__
|
||||
di.Architecture = RuntimeInformation.ProcessArchitecture + "";
|
||||
#else
|
||||
#if NET40_OR_GREATER
|
||||
try
|
||||
{
|
||||
// 收集屏幕相关信息。Mono+Linux无法获取
|
||||
|
@ -231,6 +229,8 @@ namespace Stardust
|
|||
di.Resolution = $"{screen.Bounds.Width}*{screen.Bounds.Height}";
|
||||
}
|
||||
catch { }
|
||||
#else
|
||||
di.Architecture = RuntimeInformation.ProcessArchitecture + "";
|
||||
#endif
|
||||
|
||||
if (Runtime.Linux) di.MaxOpenFiles = Execute("bash", "-c \"ulimit -n\"")?.Trim().ToInt() ?? 0;
|
||||
|
@ -370,9 +370,7 @@ namespace Stardust
|
|||
Time = DateTime.UtcNow.ToLong(),
|
||||
Delay = Delay,
|
||||
};
|
||||
#if __CORE__
|
||||
//ext.Uptime = Environment.TickCount64 / 1000;
|
||||
#endif
|
||||
// 开始时间 Environment.TickCount 很容易溢出,导致开机24天后变成负数。
|
||||
// 后来在 netcore3.0 增加了Environment.TickCount64
|
||||
// 现在借助 Stopwatch 来解决
|
||||
|
@ -484,7 +482,7 @@ namespace Stardust
|
|||
{
|
||||
if (_timer == null)
|
||||
{
|
||||
#if !NET4
|
||||
#if !NET40
|
||||
_timer = new TimerX(DoPing, null, 1_000, 60_000, "Device") { Async = true };
|
||||
#else
|
||||
_timer = new TimerX(s=>Ping().Wait(), null, 1_000, 60_000, "Device") { Async = true };
|
||||
|
@ -499,7 +497,7 @@ namespace Stardust
|
|||
_timer.TryDispose();
|
||||
_timer = null;
|
||||
|
||||
#if !NET4
|
||||
#if !NET40
|
||||
if (_websocket != null && _websocket.State == WebSocketState.Open) _websocket.CloseAsync(WebSocketCloseStatus.NormalClosure, "finish", default).Wait();
|
||||
_source?.Cancel();
|
||||
|
||||
|
@ -508,7 +506,7 @@ namespace Stardust
|
|||
#endif
|
||||
}
|
||||
|
||||
#if !NET4
|
||||
#if !NET40
|
||||
private WebSocket _websocket;
|
||||
private CancellationTokenSource _source;
|
||||
private async Task DoPing(Object state)
|
||||
|
|
|
@ -45,7 +45,12 @@ namespace Stardust
|
|||
#endregion
|
||||
|
||||
#region 构造
|
||||
/// <summary>指定地址、应用和密钥,创建工厂</summary>
|
||||
/// <summary>
|
||||
/// 实例化星尘工厂,先后读取appsettings.json、本地StarAgent、star.config
|
||||
/// </summary>
|
||||
public StarFactory() => Init();
|
||||
|
||||
/// <summary>实例化星尘工厂,指定地址、应用和密钥,创建工厂</summary>
|
||||
/// <param name="server">服务端地址。为空时先后读取appsettings.json、本地StarAgent、star.config</param>
|
||||
/// <param name="appId">应用标识。为空时读取star.config</param>
|
||||
/// <param name="secret">应用密钥。为空时读取star.config</param>
|
||||
|
@ -57,12 +62,6 @@ namespace Stardust
|
|||
Secret = secret;
|
||||
|
||||
Init();
|
||||
|
||||
var ioc = ObjectContainer.Current;
|
||||
ioc.AddSingleton(this);
|
||||
ioc.AddSingleton(p => Tracer);
|
||||
ioc.AddSingleton(p => Config);
|
||||
ioc.AddSingleton(p => Service);
|
||||
}
|
||||
|
||||
/// <summary>销毁</summary>
|
||||
|
@ -160,6 +159,12 @@ namespace Stardust
|
|||
}
|
||||
|
||||
XTrace.WriteLine("星尘分布式服务 Server={0} AppId={1}", Server, AppId);
|
||||
|
||||
var ioc = ObjectContainer.Current;
|
||||
ioc.AddSingleton(this);
|
||||
ioc.AddSingleton(p => Tracer);
|
||||
ioc.AddSingleton(p => Config);
|
||||
ioc.AddSingleton(p => Service);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -320,7 +325,7 @@ namespace Stardust
|
|||
#endregion
|
||||
|
||||
#region 日志
|
||||
/// <summary>日志</summary>
|
||||
/// <summary>日志。默认 XTrace.Log</summary>
|
||||
public ILog Log { get; set; } = XTrace.Log;
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net45;netstandard2.0;net5.0;net40</TargetFrameworks>
|
||||
<TargetFrameworks>net40;net45;netstandard2.0;net5.0;net6.0</TargetFrameworks>
|
||||
<AssemblyName>Stardust</AssemblyName>
|
||||
<AssemblyTitle>星尘分布式服务扩展</AssemblyTitle>
|
||||
<Description>星尘,分布式服务框架。分布式资源调度,服务自动注册和发现,负载均衡,动态伸缩,故障转移,性能监控。</Description>
|
||||
<Description>星尘,分布式服务框架。节点管理,监控中心,配置中心,发布中心,注册中心</Description>
|
||||
<Company>新生命开发团队</Company>
|
||||
<Copyright>©2002-2021 NewLife</Copyright>
|
||||
<Version>1.5.2021.1109</Version>
|
||||
<FileVersion>1.5.2021.1109</FileVersion>
|
||||
<Version>1.5.2021.1118</Version>
|
||||
<FileVersion>1.5.2021.1118</FileVersion>
|
||||
<AssemblyVersion>1.5.*</AssemblyVersion>
|
||||
<Deterministic>false</Deterministic>
|
||||
<OutputPath>..\..\Bin</OutputPath>
|
||||
|
@ -33,19 +33,6 @@
|
|||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
|
||||
<DefineConstants>$(DefineConstants);NETSTANDARD2_0;__CORE__</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(TargetFramework)'=='net5.0'">
|
||||
<DefineConstants>$(DefineConstants);NET50;__CORE__</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(TargetFramework)'=='net40'">
|
||||
<DefineConstants>$(DefineConstants);__WIN__;NET4</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(TargetFramework)'=='net45'">
|
||||
<DefineConstants>$(DefineConstants);__WIN__;NET45</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
|
||||
<DefineConstants>$(DefineConstants);DEBUG</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
|
@ -68,8 +55,4 @@
|
|||
<PackageReference Include="NewLife.Core" Version="8.11.2021.1109" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)'=='net45'">
|
||||
<Reference Include="System.Net.Http" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
Loading…
Reference in New Issue