小编use*_*146的帖子

Swashbuckle 和 Swagger 库无法识别“信息”类

我是否缺少包或参考,因为我的AddSwaggerGen方法无法编译。我的代码:

我加了 using Swashbuckle.AspNetCore.Swagger;

但是这个代码

  services.AddSwaggerGen(c =>
   {
     c.SwaggerDoc("v1", new Info { Title = "My API", Version = "v1" });                 
     c.EnableAnnotations();    
   });
Run Code Online (Sandbox Code Playgroud)

不会编译:

错误 CS0246 找不到类型或命名空间名称“信息”(您是否缺少 using 指令或程序集引用?)这是 csproj

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <DebugType>full</DebugType>
    <DebugSymbols>true</DebugSymbols>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
    <DebugType>full</DebugType>
    <DebugSymbols>true</DebugSymbols>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="IdentityModel" Version="3.10.6" />
    <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="5.0.0-rc2" />
    <PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="5.0.0-rc2" />
    <PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="5.0.0-rc2" />
    <PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="5.0.0-rc2" />
  </ItemGroup>
Run Code Online (Sandbox Code Playgroud)

c# swagger asp.net-core

8
推荐指数
2
解决办法
4873
查看次数

您可以将 Xamarin.Forms 4.0 与 Shell 和 Prism 框架一起使用吗

您可以将 Xamarin Forms 4.0 新 Shell 与 Prism 一起使用吗?我正在寻找示例或一些文档

prism xamarin xamarin.forms

7
推荐指数
2
解决办法
2536
查看次数

标签 统计

asp.net-core ×1

c# ×1

prism ×1

swagger ×1

xamarin ×1

xamarin.forms ×1