Skip to content

Microsoft.Aspnetcore.Authorization namespace is missing with .NET Core 2.2 #4532

@idealser

Description

@idealser

Microsoft.Aspnetcore.Authorization namespace is missing when using .NET Core 2.2

To Reproduce

  1. Set TargetFramework of .csproj file to "netcoreapp2.2"
  2. Set RuntimeFrameworkVersion to "2.2.0"
  3. Include PackageReference "Microsoft.AspNetCore.App"
  4. Try to use Authorize attribute or to Microsoft.AspNetCore.Authorization namespace in any controller.
  5. Namespace is not found.
<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <RuntimeFrameworkVersion>2.2.0</RuntimeFrameworkVersion>
    <DebugType>Full</DebugType>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App"/>
  </ItemGroup>
</Project>

Expected behavior
Running the same project with net core 2.1 works fine. Tried to include Microsoft.AspNetCore.Authorization package explicitly using nuget with no success. Error appears to be the same.

Screenshots
image

Desktop:

  • OS: Windows 10 x64
  • IDE: Visual Studio 15.9.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-authIncludes: Authn, Authz, OAuth, OIDC, Bearer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions