From b6e03b2367d513af7e1180cb52903d74bb741b10 Mon Sep 17 00:00:00 2001 From: "DESKTOP-M4V1LH5\\Jin" Date: Mon, 9 Jul 2018 12:44:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- COMCMS.Core/COMCMS.Core.csproj | 2 +- COMCMS.Web/COMCMS.Web.csproj | 6 +++--- COMCMS.Web/Startup.cs | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/COMCMS.Core/COMCMS.Core.csproj b/COMCMS.Core/COMCMS.Core.csproj index 9e28b9c..b61a5ca 100644 --- a/COMCMS.Core/COMCMS.Core.csproj +++ b/COMCMS.Core/COMCMS.Core.csproj @@ -5,7 +5,7 @@ - + diff --git a/COMCMS.Web/COMCMS.Web.csproj b/COMCMS.Web/COMCMS.Web.csproj index a42f220..bc29e6e 100644 --- a/COMCMS.Web/COMCMS.Web.csproj +++ b/COMCMS.Web/COMCMS.Web.csproj @@ -8,10 +8,10 @@ - + - - + + diff --git a/COMCMS.Web/Startup.cs b/COMCMS.Web/Startup.cs index a762b29..e257cee 100644 --- a/COMCMS.Web/Startup.cs +++ b/COMCMS.Web/Startup.cs @@ -24,6 +24,7 @@ using Senparc.Weixin; using Senparc.CO2NET.Cache; using System.Configuration; using Microsoft.Extensions.Options; +using Senparc.Weixin.RegisterServices; namespace COMCMS.Web { @@ -74,6 +75,8 @@ namespace COMCMS.Web { options.Filters.Add(); }); + services.AddSenparcGlobalServices(Configuration)//Senparc.CO2NET 全局注册 + .AddSenparcWeixinServices(Configuration);//Senparc.Weixin 注册(如果使用Senparc.Weixin SDK则添加) } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. @@ -128,8 +131,7 @@ namespace COMCMS.Web }); app.UseMiddlewareExtension(new ResultExceptionHandler()); - RegisterService.Start(env, senparcSetting.Value) - .UseSenparcWeixin(senparcWeixinSetting.Value, false/*此处为单独用于微信的调试状态*/, () => GetExContainerCacheStrategies()); + IRegisterService register = RegisterService.Start(env, senparcSetting.Value).UseSenparcGlobal(); //加入HttpContext //MyHttpContext.ServiceProvider = svp; }