반응형
asp.net ID 데이터 테이블을 다시 생성하든 관계없이 사용자 관리자에 액세스하자마자 응용 프로그램이 질식합니다.
The entity type ApplicationUser is not part of the model for the current context.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The entity type ApplicationUser is not part of the model for the current context.
Source Error:
Line 65: ' Create a local login before signing in the user
Line 66: Dim user = New ApplicationUser() With {.UserName = model.UserName}
**Line 67: Dim result = Await UserManager.CreateAsync(User, model.Password)**
Line 68: If result.Succeeded Then
Line 69: Await SignInAsync(User, isPersistent:=False)
내 DbContext 모델에서 ApplicationDBContext를 가리 켰습니다.
Public Class ApplicationDbContext
Inherits IdentityDbContext(Of ApplicationUser)
Public Sub New()
MyBase.New("IMSEntities")
End Sub
End Class
인터넷 검색은 자신의 보안 공급자를 포기하고 코딩 한 사람들을 찾는 경향이 있습니다. 가능하면 표준 공급자를 사용하고 싶습니다. 당황!
해결 방법
(무효?) 솔루션 :
<add name="IMSSecurityEntities" connectionString="data source=localhost;database=mydb;Uid=id;Pwd=password;" providerName="mysql.data.mysqlclient"/>
마찬가지로 신원 모델은 다음과 같이 조정되어야합니다.
Public Class ApplicationDbContext
Inherits IdentityDbContext(Of ApplicationUser)
Public Sub New()
MyBase.New("IMSSecurityEntities")
End Sub
이로 인해 ORM을 통해 보안 엔티티에 액세스하는 것이 불안해집니다.하지만 의도적으로 설계된 것일 수 있으므로 손실이 없을 수도 있습니다.
참조 페이지 https://stackoverflow.com/questions/22592770
반응형
'MySql' 카테고리의 다른 글
MySQL 한 열에 동일한 값을 포함하는 MYSQL 행을 계산하는 PHP (0) | 2020.12.09 |
---|---|
MySQL mysql 업데이트 쿼리의 값 증가 (0) | 2020.12.09 |
MySQL Windows의 MySql 환경 변수 (0) | 2020.12.09 |
MySQL 매개 변수 '@myLeft'를 정의해야합니다. (0) | 2020.12.09 |
MySQL AWS RDS 엔드 포인트를 ping 할 수 없습니다. (0) | 2020.12.08 |
댓글