Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
模型未使用Swagger获取Xml注释的类库_Swagger_Swagger Ui_Asp.net Core Webapi_Swashbuckle_Asp.net Core 2.1 - Fatal编程技术网

模型未使用Swagger获取Xml注释的类库

模型未使用Swagger获取Xml注释的类库,swagger,swagger-ui,asp.net-core-webapi,swashbuckle,asp.net-core-2.1,Swagger,Swagger Ui,Asp.net Core Webapi,Swashbuckle,Asp.net Core 2.1,我有一个用于我的模型的.net core 2.1类库,我在多个asp.net core web api项目中使用它。我在API文档中使用了Swagger(3.0.0版)。对于类库中的模型,Xml注释不会显示。是的,我在Startup.cs中有includexmlcomcomments。如何让Xml注释在模型类库中工作 注意:我的项目目录中的模型由Swagger正确记录 这里是我包含Xml注释的地方: services.AddSwaggerGen(c => { c.SwaggerD

我有一个用于我的模型的.net core 2.1类库,我在多个asp.net core web api项目中使用它。我在API文档中使用了Swagger(3.0.0版)。对于类库中的模型,Xml注释不会显示。是的,我在Startup.cs中有includexmlcomcomments。如何让Xml注释在模型类库中工作

注意:我的项目目录中的模型由Swagger正确记录


这里是我包含Xml注释的地方:

services.AddSwaggerGen(c => { 
    c.SwaggerDoc("v1", new Info { Title = "Web API", Version = "v1" }); 
    c.IncludeXmlComments($@"{System.AppDomain.CurrentDomain.BaseDirectory}\ABC.Application.WebApi.xml"); 
}); 

你能分享你的一些代码吗,特别是你使用
includexmlcomcomments
的那部分,这里是我包含Xml注释的地方:services.AddSwaggerGen(c=>{c.SwaggerDoc(“v1”,newinfo{Title=“webapi”,Version=“v1”);c.includexmlcomcomments($@){System.AppDomain.CurrentDomain.BaseDirectory}\ABC.Application.WebApi.xml“;});看起来您只有一个
includexmlcoments
,但您应该至少有两个,一个用于WebApi,另一个用于包含模型的类库。