- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我尝试添加
<PackageReference Include="Microsoft.AspNetCore.Razor.Runtime" Version="2.2.0" />
但是2.2.0是目前可用的最新版本,与错误不匹配。重建应用程序后错误仍然相同。
项目.csproj:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="3.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.0" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="3.1.0" />
</ItemGroup>
</Project>
完整错误:
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.Razor.Runtime, Version=3.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
File name: 'Microsoft.AspNetCore.Razor.Runtime, Version=3.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(MetadataToken caCtorToken, MetadataImport& scope, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder
1& derivedAttributes, RuntimeType&
1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder
attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters,
Boolean& isVarArg) at
System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder1 derivedAttributes) at
1 configureOptions) at Microsoft.Extensions.DependencyInjection.IdentityServiceCollectionUIExtensions.AddDefaultIdentity[TUser](IServiceCollection services) at pieshop.Startup.ConfigureServices(IServiceCollection services) in /home/juan/code/web-projects/pieshop/src/Startup.cs:line 36 at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule
decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount,
RuntimeType attributeFilterType) at
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly
assembly, RuntimeType caType) at
System.Reflection.RuntimeAssembly.GetCustomAttributes(Type
attributeType, Boolean inherit) at
System.Attribute.GetCustomAttributes(Assembly element, Type
attributeType, Boolean inherit) at
System.Attribute.GetCustomAttribute(Assembly element, Type
attributeType, Boolean inherit) at
System.Reflection.CustomAttributeExtensions.GetCustomAttribute[T](Assembly
element) at
Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartFactory.GetApplicationPartFactory(Assembly
assembly) at
Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartManager.PopulateDefaultParts(String
entryAssemblyName) at
Microsoft.Extensions.DependencyInjection.MvcCoreServiceCollectionExtensions.GetApplicationPartManager(IServiceCollection
services) at
Microsoft.Extensions.DependencyInjection.MvcCoreServiceCollectionExtensions.AddMvcCore(IServiceCollection
services) at
Microsoft.Extensions.DependencyInjection.MvcServiceCollectionExtensions.AddControllersCore(IServiceCollection
services) at
Microsoft.Extensions.DependencyInjection.MvcServiceCollectionExtensions.AddControllersWithViewsCore(IServiceCollection
services) at
Microsoft.Extensions.DependencyInjection.MvcServiceCollectionExtensions.AddControllersWithViews(IServiceCollection
services) at
Microsoft.Extensions.DependencyInjection.MvcServiceCollectionExtensions.AddMvc(IServiceCollection
services) at
Microsoft.AspNetCore.Identity.IdentityBuilderUIExtensions.AddRelatedParts(IdentityBuilder
builder) at
Microsoft.AspNetCore.Identity.IdentityBuilderUIExtensions.AddDefaultUI(IdentityBuilder
builder) at
Microsoft.Extensions.DependencyInjection.IdentityServiceCollectionUIExtensions.AddDefaultIdentity[TUser](IServiceCollection
services, Action
at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services) at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass9_0.g__Startup|0(IServiceCollection serviceCollection) at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.Invoke(Object instance, IServiceCollection services) at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass8_0.b__0(IServiceCollection services) at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.UseStartup(Type startupType, HostBuilderContext context, IServiceCollection services) at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass12_0.b__0(HostBuilderContext context, IServiceCollection services) at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider() at Microsoft.Extensions.Hosting.HostBuilder.Build() at pieshop.Program.Main(String[] args) in /home/juan/code/web-projects/pieshop/src/Program.cs:line 10
Startup.cs第36行:
services.AddDefaultIdentity<IdentityUser>()
.AddEntityFrameworkStores<AppDbContext>();
解决了!我按以下顺序单独卸载了 dotnet 软件包:dotnet-sdk-bin (AUR)dotnet-运行时-bin (AUR)dotnet-host-bin (AUR)
然后我以相反的顺序构建了这些相同的包。现在,从今天开始,它们都在 3.1.1.sdk101-2,我的项目再次运行。
最佳答案
我也注意到了同样的事情,请查看框架的 ms 更新,几天前有一个更新,预计已安装较新的 nuget 软件包。
您遇到的问题是 nuget 软件包与您的 SDK 不匹配,至少我是这样。在进行 Windows 更新并安装新的 Core Runtime 后,Version=3.1.1.0 一切正常
关于c# - 在 Linux 上的 ASP.NET Core MVC 项目中使用身份脚手架后运行项目时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59777283/
我读了here您可以使用命令构建模块,因此您无需手动创建一些初始文件。但是这样的命令在 master 上不起作用(在 Odoo 开发分支上): ./oe scaffold Academy ../my-
我是 Grails 新手。我有一个 Person 域类: class Person { String firstName String lastName String gend
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 9 年前。 Improve this
我使用 yeoman 作为脚手架工具,但出现以下错误。任何人都可以帮我解决这个问题。我正在使用 Windows 8 环境。 karma-jasmine@0.1.5 node_modules\karma
我正在查看使用grails generate-all生成的 Controller 。为什么同时存在create和save操作,是否有原因?对于我来说,仅将create作为操作并将save作为服务对我来
我是个新手。我现在正在研究脚手架模板,尤其是在 Controller 上。我每次生成时都想要一个自定义的 Controller ,所以我使用了“安装模板”。我总是在 Controller 上创建Com
我有一个类库,其中包含一些模型类和一个 DbContext 类(所有这些类都是公共(public)的)。该类库由 MVC-5 应用程序引用。 是否可以使用该引用类库中的模型类来构建该 MVC-5 应用
我有一个使用 Twitter Bootstrap 构建的单页应用程序。我的应用程序有几个模态对话框,它们通常占页面宽度的 70%,并且水平居中。我的页面和模态设置是这样的: 我在模态框内放置了一行和几
我正在开发一个具有某种“协调器”界面的网络应用程序。我希望能够支持我正在使用的 Eyefinity 设置(即 3 个纵向显示器,分辨率为 3600x1920,或 3780x1920,并启用了边框校正)
在处理 codeigniter 中的脚手架时,我有哪些选择 - 人们经常使用脚手架吗?或者是否有更好的方法来快速生成用于 CRUD 应用程序的代码? 我已经安装了 Spark 塞:http://cod
我正在我工作的公司解决方案中实现存储库模式,将后端项目中的模型类与 DbContexts 项目中的数据库上下文和迁移分开。 我正在使用 Scaffold-DbContext 将我的后端项目设置为模型类
目录 1、前言 2、什么是脚手架呢? 3、谁提供了脚手架? 1、Spring 官网脚手架 2、阿里云脚手架 4、手撸一个脚手架!
我在脚手架中有一个应用栏。 return Scaffold( appBar: styling.appBar( AppBar( leading: styling.icon
我正在尝试使用 Compose 设计一个布局,其中包括: 热门应用栏 正文(内容) 底部应用栏 单击时表示菜单的底部表(模态底部表) -------TopAppBar------ ------主要内容
有谁知道如何为所有对象属性“构建”或“生成”构造函数块?我有 VS2010 和 Resharper,我希望生成类似的东西: public Customer CustomerB = new Cu
我正在尝试在 grails 中上传文件。生成的脚手架对我不起作用,给我一个 404 寻找“save.jsp” 域名 class Simple{ byte [] avatar static co
因为我已经手动调整了我的实体和 Controller 以及 View ,所以我希望 roo 不更改它们中的任何一个。尽管如此,我还是希望继续为所有新实体搭建脚手架。我怎么能那样做 最佳答案 您可以通过
我使用命令grails generate-restful-controller Domain创建了一个 Restful Controller ,如何在创建的 Controller 中设置scaffol
我有一个定义了 staticscaffold = true 的 Controller ,以及一些自定义操作。 我想确保只有登录用户和 ADMIN 类型的用户(我们域中的某些 Enum 值)才能访问它。
我有一个表,其中某些列的值相对较长,并且在我的 Grails 应用程序中为其打开了动态脚手架(我使用的是 Grails 3.3.8)。因此,在某些屏幕分辨率下,它们不适合屏幕,并且最右边的列最终会出现
我是一名优秀的程序员,十分优秀!