From 723ba3e3136a765c3750ad970c810bf703ed4da6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Mon, 13 Feb 2023 21:41:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=B3=A8=E8=A7=A3=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=94=9F=E6=88=90=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Admin.WebApi/Extensions/SwaggerExtension.cs | 4 ++-- ZR.Admin.WebApi/ZR.Admin.WebApi.csproj | 1 + ZR.Model/ZR.Model.csproj | 15 +++++++++------ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ZR.Admin.WebApi/Extensions/SwaggerExtension.cs b/ZR.Admin.WebApi/Extensions/SwaggerExtension.cs index 775cf31..b51c127 100644 --- a/ZR.Admin.WebApi/Extensions/SwaggerExtension.cs +++ b/ZR.Admin.WebApi/Extensions/SwaggerExtension.cs @@ -38,7 +38,7 @@ namespace ZR.Admin.WebApi.Extensions public static void AddSwaggerConfig(this IServiceCollection services) { if (services == null) throw new ArgumentNullException(nameof(services)); - IWebHostEnvironment hostEnvironment = App.GetRequiredService(); + //IWebHostEnvironment hostEnvironment = App.GetRequiredService(); services.AddSwaggerGen(c => { @@ -50,7 +50,7 @@ namespace ZR.Admin.WebApi.Extensions }); try { - var tempPath = hostEnvironment.ContentRootPath; + var tempPath = "";// hostEnvironment.ContentRootPath; //添加文档注释 c.IncludeXmlComments(Path.Combine(tempPath, "ZRAdmin.xml"), true); c.IncludeXmlComments(Path.Combine(tempPath, "ZRModel.xml"), true); diff --git a/ZR.Admin.WebApi/ZR.Admin.WebApi.csproj b/ZR.Admin.WebApi/ZR.Admin.WebApi.csproj index e82db61..b2a3bf5 100644 --- a/ZR.Admin.WebApi/ZR.Admin.WebApi.csproj +++ b/ZR.Admin.WebApi/ZR.Admin.WebApi.csproj @@ -3,6 +3,7 @@ net7.0 enable enable + True diff --git a/ZR.Model/ZR.Model.csproj b/ZR.Model/ZR.Model.csproj index 6fec8b7..fc80f1f 100644 --- a/ZR.Model/ZR.Model.csproj +++ b/ZR.Model/ZR.Model.csproj @@ -2,13 +2,16 @@ net7.0 + True + ../ZR.Admin.WebApi/ZRModel.xml + 1701;1702;1591;1570 - - - - - - + + + + + +