Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection Already Exist #25

Closed
webzest opened this issue Mar 20, 2021 · 4 comments
Closed

Connection Already Exist #25

webzest opened this issue Mar 20, 2021 · 4 comments

Comments

@webzest
Copy link

webzest commented Mar 20, 2021

Describe the bug
InvalidOperationException: There is already an open DataReader associated with this Connection which must be closed first.

To Reproduce
Steps to reproduce the behavior:
Generated a new application with dotnet.
Upgraded to the latest Nuget packages.
Conducted the Migrations to create the new database on my local MSSQL 2019 Server
Tested the Token API Successfully.
Selected the Web as default App and logged in with the default Super Admin User

  1. Go to 'Admin Settings'
  2. Click on 'Users'
  3. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser chrome
  • Version latest

Additional context
Clicking on Roles worked, but the remaining links did not. Same error was generated

@scrnjakovic
Copy link

I reported same issue in #21 two weeks ago although in my case MS SQL worked, while MySQL and postgresql didn't. Same error, same thing regarding only Roles section working. If you find something out, let me know, as it doesn't look like we'll be getting help here :)

@iamshen
Copy link

iamshen commented Mar 30, 2021

in postgres

Your.Web/Permission/PermissionAuthorizationHandler.cs

var userRoles = _roleManager.Roles.Where(x => userRoleNames.Contains(x.Name));

change to

var userRoles = _roleManager.Roles.Where(x => userRoleNames.Contains(x.Name)).ToList();

This is because do foreach over an EF Core LINQ query isn't supported

@webzest webzest closed this as completed Mar 30, 2021
@webzest
Copy link
Author

webzest commented Mar 30, 2021

Yes, that is the solution. Thank You!

@thanhdongha
Copy link

thanks, it's worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants