2017-06-14 65 views
0

我已經創建了一個.NET Core Web API,並且我正在跟隨this tutorial添加swagger支持。添加引用Swashbuck.AspNetCore.Swagger給我紅色波浪狀

我已經添加了Swashbuckle.AspNetCore nuget包,但是當我添加using Swashbuckle.AspNetCore.Swagger;時,在Swashbuckle下有一個紅色波浪形。我無法致電AddSwaggerGen

有沒有人有工作樣品,或知道我出錯的地方?

enter image description here

enter image description here

enter image description here

+0

什麼版本的vs你使用2015年或2017年 –

+1

我在2017年安裝金塊時遇到了這個問題我剛剛關閉VS並重新打開,一切正常。 –

+0

這實際上是重新啓動VS -.- –

回答

2

我跟着教程的一部分使用vs2017,一切似乎確定對我說: https://github.com/RSereno/TodoApi2

你可以檢查*.csproj文件,看是否參考添加正確:

<ItemGroup> <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" /> <PackageReference Include="Microsoft.AspNetCore" Version="1.1.2" /> <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.3" /> <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.2" /> <PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="1.1.1" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0" /> </ItemGroup>

紅色的波浪狀的東西可以幫助你找出whats happennig(找不到嗎?曖昧等)

ps:我不能評論,所以我試圖說它有一個迴應。

相關問題