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 - - - - - - + + + + + +