Browse Source

simple union of 2 projects

master
parent
commit
4f2a5fbf8a
  1. 3
      .gitignore
  2. 26
      .vscode/launch.json
  3. 41
      .vscode/tasks.json
  4. 20
      Program.cs
  5. 11
      Properties/launchSettings.json
  6. 33
      Worker.cs
  7. 8
      appsettings.Development.json
  8. 8
      appsettings.json
  9. 30
      deep-cms.csproj

3
.gitignore vendored

@ -1,3 +1,6 @@
bin/
obj/
# ---> VisualStudioCode
.vscode/*
!.vscode/settings.json

26
.vscode/launch.json vendored

@ -0,0 +1,26 @@
{
"version": "0.2.0",
"configurations": [
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/bin/Debug/net6.0/deep-cms.dll",
"args": [],
"cwd": "${workspaceFolder}",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}

41
.vscode/tasks.json vendored

@ -0,0 +1,41 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/deep-cms.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/deep-cms.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/deep-cms.csproj"
],
"problemMatcher": "$msCompile"
}
]
}

20
Program.cs

@ -0,0 +1,20 @@
using tias.deep.CMS;
using Microsoft.Extensions.Hosting;
public class Program
{
public static void Main(string[] args)
{
IHost host = Host.CreateDefaultBuilder(args)
.ConfigureServices(services =>
{
services.AddHostedService<Worker>();
})
.UseSystemd()
.UseWindowsService()
.Build();
host.Run();
}
}

11
Properties/launchSettings.json

@ -0,0 +1,11 @@
{
"profiles": {
"deep_cms": {
"commandName": "Project",
"dotnetRunMessages": true,
"environmentVariables": {
"DOTNET_ENVIRONMENT": "Development"
}
}
}
}

33
Worker.cs

@ -0,0 +1,33 @@
namespace tias.deep.CMS;
public class Worker : BackgroundService
{
private tias.deep.server.core.Init _server;
public Worker()
{
this._server = new tias.deep.server.core.Init();
}
public override Task StartAsync(CancellationToken cancellationToken)
{
_server.StartServer(false);
return base.StartAsync(cancellationToken);
}
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
while (!stoppingToken.IsCancellationRequested)
{
await Task.Delay(1000, stoppingToken);
}
}
public override Task StopAsync(CancellationToken cancellationToken)
{
_server.StopServer();
return base.StopAsync(cancellationToken);
}
}

8
appsettings.Development.json

@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.Hosting.Lifetime": "None"
}
}
}

8
appsettings.json

@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.Hosting.Lifetime": "None"
}
}
}

30
deep-cms.csproj

@ -0,0 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk.Worker">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>dotnet-deep_cms-101b2c8f-ab12-408d-95e1-fab0acc1536e</UserSecretsId>
<RootNamespace>tias.deep.CMS</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="../deep-server-core/deep-server-core-dotnet.csproj" />
<ProjectReference Include="../deep-server-cms/deep-server-cms-backend.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.SystemD" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<None Update="settings\**" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup>
<None Update="webclient\**" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
</Project>
Loading…
Cancel
Save