gpt4 book ai didi

c# - 缺少程序集引用——但我相信包被正确引用

转载 作者:行者123 更新时间:2023-12-04 09:43:20 25 4
gpt4 key购买 nike

当我注册以下 using声明:

using Microsoft.AspNetCore.Identity.UI;

我收到以下错误:

'UI' type or namespace name does not exist in namespace 'Microsoft.AspNetCore.Identity' (missing an assembly reference?)

我觉得一切都很好。我包括一个 <PackageReference>the Microsoft.AspNetCore.Identity.UI NuGet package .但错误仍然存​​在。

我该如何解决这个问题?

我的 .csproj

<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.1.4" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="3.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SQLite" Version="3.1.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.3" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.3" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.1.1" />
</ItemGroup>
</Project>

还有我的AssemblyInfo.cs :

using System;
using System.Reflection;

[assembly: Microsoft.AspNetCore.Identity.UI.UIFrameworkAttribute("Bootstrap4")]
[assembly: System.Reflection.AssemblyCompanyAttribute("ESporcum")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("ESporcum")]
[assembly: System.Reflection.AssemblyTitleAttribute("ESporcum")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

最佳答案

在 NuGet 包中

改变这个:

Microsoft.AspNetCore.Identity.UI Ver.5.0.1

到:

Microsoft.AspNetCore.Identity.UI Ver.3.1.10

关于c# - 缺少程序集引用——但我相信包被正确引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62235721/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com