minChz.|<_|

This commit is contained in:
Paul Schneider 2018-02-25 03:33:54 +01:00
commit 77e229fc8a
30 changed files with 3182 additions and 95 deletions

View file

@ -5,12 +5,11 @@ using System.ServiceProcess;
using System.Threading.Tasks;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Hosting.Internal;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Framework.Configuration;
using Microsoft.Framework.ConfigurationModel;
using Yavsc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNet.Hosting.Internal;
public class Program : ServiceBase
{
@ -32,24 +31,6 @@ public class Program : ServiceBase
// public static void Main(string[] args) => Console.WriteLine("Hello World!");
public void OldMain(string[] args)
{
Microsoft.Extensions.PlatformAbstractions.IApplicationEnvironment iappenv;
IHostingEnvironment env = new Microsoft.AspNet.Hosting.HostingEnvironment();
iappenv = null;// new HostingEnvironmentExtensions();
Console.WriteLine("HW");
_log.WriteEntry("Test from MyDnxService.", EventLogEntryType.Information, 1);
#if DEBUG
OnStart(null);
#else
Run(this);
#endif
}
protected override void OnStart(string[] args)
{
@ -61,7 +42,7 @@ public class Program : ServiceBase
var configBuilder = new ConfigurationBuilder();
configBuilder.AddInMemoryCollection();
configBuilder.SetBasePath("../Yavsc/");
configBuilder.AddJsonFile("../Yavsc/project.json");
configBuilder.AddJsonFile("../Yavsc/appsettings.Development.json");
var config = configBuilder.Build();
var builder = new WebHostBuilder();

View file

@ -42,6 +42,7 @@ namespace YaDaemon
using (var prog = new YaDaemon()) {
try {
await prog.StartAsync(args);
prog.MainLoop(args);
} catch (Exception ex)
{

View file

@ -3,8 +3,7 @@
"description": "MyDnxService Console Application",
"dependencies": {
"Yavsc": {
"type": "build",
"version": "1.0.0"
"type": "build"
}
},
"frameworks": {

View file

@ -2889,7 +2889,7 @@
"Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta4",
"PayPalMerchant-net451": "2.7.109",
"System.Json": "4.0.20126.16343",
"Yavsc.Abstract": "1.0.0"
"Yavsc.Abstract": null
},
"frameworkAssemblies": [
"System",
@ -2898,14 +2898,15 @@
"System.Xml"
]
},
"Yavsc.Abstract/1.0.0": {
"Yavsc.Abstract/1.0.5": {
"type": "project",
"framework": ".NETFramework,Version=v4.5.1",
"dependencies": {
"Newtonsoft.Json": "10.0.2"
},
"frameworkAssemblies": [
"System.ComponentModel.DataAnnotations"
"System.ComponentModel.DataAnnotations",
"System.Json"
]
}
},
@ -5796,7 +5797,7 @@
"Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta4",
"PayPalMerchant-net451": "2.7.109",
"System.Json": "4.0.20126.16343",
"Yavsc.Abstract": "1.0.0"
"Yavsc.Abstract": null
},
"frameworkAssemblies": [
"System",
@ -5805,14 +5806,15 @@
"System.Xml"
]
},
"Yavsc.Abstract/1.0.0": {
"Yavsc.Abstract/1.0.5": {
"type": "project",
"framework": ".NETFramework,Version=v4.5.1",
"dependencies": {
"Newtonsoft.Json": "10.0.2"
},
"frameworkAssemblies": [
"System.ComponentModel.DataAnnotations"
"System.ComponentModel.DataAnnotations",
"System.Json"
]
}
},
@ -8703,7 +8705,7 @@
"Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta4",
"PayPalMerchant-net451": "2.7.109",
"System.Json": "4.0.20126.16343",
"Yavsc.Abstract": "1.0.0"
"Yavsc.Abstract": null
},
"frameworkAssemblies": [
"System",
@ -8712,14 +8714,15 @@
"System.Xml"
]
},
"Yavsc.Abstract/1.0.0": {
"Yavsc.Abstract/1.0.5": {
"type": "project",
"framework": ".NETFramework,Version=v4.5.1",
"dependencies": {
"Newtonsoft.Json": "10.0.2"
},
"frameworkAssemblies": [
"System.ComponentModel.DataAnnotations"
"System.ComponentModel.DataAnnotations",
"System.Json"
]
}
}
@ -8729,7 +8732,7 @@
"type": "project",
"path": "../Yavsc/project.json"
},
"Yavsc.Abstract/1.0.0": {
"Yavsc.Abstract/1.0.5": {
"type": "project",
"path": "../Yavsc.Abstract/project.json"
},
@ -11713,7 +11716,7 @@
},
"projectFileDependencyGroups": {
"": [
"Yavsc >= 1.0.0"
"Yavsc "
],
"DNX,Version=v4.5.1": [
"fx/System.ServiceProcess >= 4.0.0"