Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "elecosoftseservice"

Hi,

Unfortunately I'm unable to send across the project code as it's the companies IP and would likely have to go through Legal to get an NDA drawn up.

If you're able to give some pointers though, that would be very helpful.

I'm unsure of the inner workings of the Authentication framework to know what the exception message is telling me is going on, or where to look to debug this further. Can you suggest maybe where to look or what this code is trying to do please?

Hi, many thanks for checking this through so quickly.

I haven't changed EF tracking from the default in the solution.

I'm unsure of the inner workings of the Authentication framework to know what the exception message is telling me is going on, or where to look to debug this further. Can you suggest maybe where to look or what this code is trying to do please?

  • What is your product version? v11.0.1
  • What is your product type (Angular or MVC)? Angular
  • What is product framework type (.net framework or .net core)? .Net Core 6

I've been trying to implement E-mail based tenant login, and have used the code in these articles below:

https://docs.aspnetzero.com/en/aspnet-core-angular/latest/Core-Angular-Sign-In-Without-Specifying-Tenant https://support.aspnetzero.com/QA/Questions/10855/remove-tenant-from-the-login-screen---You-are-not-logged-in-as-a-host-user

When trying this out, I get past the code which Logs in the user, but an exception is raised further down:

TokenAuthController.cs CreateJwtClaims():

await _userManager.AddTokenValidityKeyAsync( user, tokenValidityKey, expirationDate );

System.InvalidOperationException: The navigation 'User.Tokens' cannot be loaded because the entity is not being tracked. Navigations can only be loaded for tracked entities. at Microsoft.EntityFrameworkCore.Internal.EntityFinder1.<LoadAsync>d__11.MoveNext() at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.<EnsureCollectionLoadedAsync>d__451.MoveNext() at Abp.Domain.Repositories.RepositoryExtensions.<EnsureCollectionLoadedAsync>d__03.MoveNext() at Abp.Authorization.Users.AbpUserStore2.<>c__DisplayClass170_0.<<AddTokenValidityKeyAsync>b__0>d.MoveNext() at Abp.Domain.Uow.UnitOfWorkManagerExtensions.<WithUnitOfWorkAsync>d__1.MoveNext() at Abp.Authorization.Users.AbpUserStore2.<AddTokenValidityKeyAsync>d__170.MoveNext() at Abp.Authorization.Users.AbpUserManager`2.

Any ideas on what could be causing this?

Answer

For the benefit of any others trying to solve this, I finally managed to get this working as part of the DevOps Release pipeline, but encountered many problems along the way.

Most notable is that if I tried to execute the Migrator exe as part of the Release agent tasks, it failed to access the Azure SQL Database - this is because it is running in the context of the Agent server, whose IP address is taken from a pool, and that pool is cycled weekly, so no chance of Whitelisting it in the Azure SQL Server firewall.

I got around this by creating a new MVC Controller in the Web.Host project, and added an Action that launches the Migrator exe. Then I created a PowerShell task in the Release pipeline that make a simple Http Get call to the new Action.

Answer

I'm also wanting to do exactly this.

Should I publish the Migrator app to the same Azure app server as the Middleware/API web app?

Then create and configure a Release task to execute the Migrator?

Many Thanks

  • What is your product version? v11.0.1
  • What is your product type (Angular or MVC)? Angular
  • What is product framework type (.net framework or .net core)? .NET Core

I want to write a custom Repository - which Project should I create this in and where do I register it for Dependency Injection?

Showing 11 to 16 of 16 entries