9 changed files with 180 additions and 0 deletions
			
			
		@ -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" | 
				
			||||
        } | 
				
			||||
    ] | 
				
			||||
} | 
				
			||||
@ -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" | 
				
			||||
        } | 
				
			||||
    ] | 
				
			||||
} | 
				
			||||
@ -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(); | 
				
			||||
    } | 
				
			||||
} | 
				
			||||
@ -0,0 +1,11 @@
					 | 
				
			||||
{ | 
				
			||||
  "profiles": { | 
				
			||||
    "deep_cms": { | 
				
			||||
      "commandName": "Project", | 
				
			||||
      "dotnetRunMessages": true, | 
				
			||||
      "environmentVariables": { | 
				
			||||
        "DOTNET_ENVIRONMENT": "Development" | 
				
			||||
      } | 
				
			||||
    } | 
				
			||||
  } | 
				
			||||
} | 
				
			||||
@ -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); | 
				
			||||
    } | 
				
			||||
} | 
				
			||||
@ -0,0 +1,8 @@
					 | 
				
			||||
{ | 
				
			||||
  "Logging": { | 
				
			||||
    "LogLevel": { | 
				
			||||
      "Default": "Information", | 
				
			||||
      "Microsoft.Hosting.Lifetime": "None" | 
				
			||||
    } | 
				
			||||
  } | 
				
			||||
} | 
				
			||||
@ -0,0 +1,8 @@
					 | 
				
			||||
{ | 
				
			||||
  "Logging": { | 
				
			||||
    "LogLevel": { | 
				
			||||
      "Default": "Information", | 
				
			||||
      "Microsoft.Hosting.Lifetime": "None" | 
				
			||||
    } | 
				
			||||
  } | 
				
			||||
} | 
				
			||||
@ -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…
					
					
				
		Reference in new issue