小编ale*_*exb的帖子

类型“ IdentityRole”在未引用的程序集中定义

当我尝试从IdentityDbContext继承asp.net core 2.0库中的dbcontext时,出现以下错误:

错误CS0012在未引用的程序集中定义了'IdentityRole'类型。您必须添加对程序集'Microsoft.Extensions.Identity.Stores,Version = 2.0.0.0,Culture = neutral,PublicKeyToken = adb9793829ddae60'的引用。

当我尝试安装pkg时,我得到:

找不到软件包“ Microsoft.Extensions.Identity.Stores”的版本“ 2.0.0”。在第1行:char:1 +安装包Microsoft.Extensions.Identity.Stores -Version 2.0.0 + ~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + CategoryInfo:未指定:(:) [ [安装包],异常+ FullyQualifiedErrorId:NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

我已经为此转了两天。希望很快就会有解决方案...

asp.net-core-mvc asp.net-core-2.0

5
推荐指数
1
解决办法
1017
查看次数

传递数字类型作为React组件属性

我刚刚在asp.net core 2.0(React项目类型)上开始使用React。将数字类型传递到组件时遇到麻烦。例如,如果我尝试传递数字类型(id),则会收到错误消息:

TS)类型'{id:boolean;}'不可分配给类型'IntrinsicAttributes&IntrinsicClassAttributes ...

import * as React from 'react';
interface HelloWorldProps{
  name: string
  id: number
}
export class Greeting extends React.Component<HelloWorldProps, any> {
  render() {
      return <h1>Hello, {this.props.name}</h1>;
  }
}
export default Greeting;
Run Code Online (Sandbox Code Playgroud)

当我尝试渲染组件时,在这里出现TS错误...

<HelloWorld id=1 />
Run Code Online (Sandbox Code Playgroud)

没有id属性,它可以正常工作。

reactjs asp.net-core-2.0

1
推荐指数
1
解决办法
1459
查看次数