1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Reflection;
- using System.Linq;
- using JsonRpcLite.InProcess;
- using JsonRpcLite.Network;
- using JsonRpcLite.Rpc;
- using WingServerCommon.Service;
- using WingServerCommon.Log;
- using WingServerCommon.Config;
- using WingServerCommon.Config.Parameters;
- using System.Runtime.Loader;
- using WingCloudServer.Loader;
- namespace WingCloudServer
- {
- internal class WingApplicationBuilder
- {
- public WingApplicationBuilder(string[] args)
- {
- //TODO args ? when to use
- }
- /// <summary>
- /// Start server to load all service
- /// </summary>
- internal WingApplication Build()
- {
- //=========================================================================//
- /// TODO workaround fixed, we need a better solution
- AssemblyLoadContext.Default.Resolving += (a,b)=>{
- //自定义依赖文件存放路径
- var dependenciesPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Dependencies");
- return Assembly.LoadFrom(Path.Combine(dependenciesPath, $"{b.Name}.dll"));
- };
- //=========================================================================//
- //启动短信服务 //TODO Why we need sms tool in server ? or move to sms service ?
- ProcessStarter.StartTool("Sms.Tool"); //Should be actived by deploy service in the future
- Logger.WriteLineInfo($"Process Sms.Tool started!");
- var app = new WingApplication();
- return app;
- }
- }
- }
|