【发布时间】:2019-10-08 21:53:13
【问题描述】:
我在 SwaggerConfig.cs 中添加了这个字符串
c.CustomAsset("index", thisAssembly, "Table.Web.CustomContent.index.html");
...然后我运行应用程序,转到 swagger 文档并得到错误:
发生了错误。 未找到嵌入式资源 - Table.Web.CustomContent.index.html Swashbuckle.SwaggerUi.AssetNotFound
index.html 的 build action 属性设置为 embedded resource
我应该怎么做才能解决它?
【问题讨论】:
-
我假设 this-> Table.Web.CustomContent.index.html 对应于 index.html 文件的正确路径。我的意思是它应该是命名空间和文件路径的组合
-
@SillyJohn "Table.Web" 在这种情况下是项目名称,"CustomContent" 是我创建的目录
-
应该是项目的命名空间。请参阅 Github 中的文档 - github.com/domaindrivendev/Swashbuckle#injecting-custom-content
-
@SillyJohn 酷!成功了
-
很高兴知道..:)
标签: swagger swashbuckle