Base solution for your next web application

Activities of "elecosoftseservice"

  • 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?

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

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.

  • 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?

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?

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,

Yes, if we could arrange that please it would be a great help.

Thankyou, Email sent.

For anyone else wanting a solution to this:

In your angular solution, open the file AppPreBootstrap.ts At the top of the code for static run(..) add the following lines:

if (environment.production) { abp.log.level = abp.log.levels.WARN; } //or set it to ERROR if preferred

That will stop any DEBUG or INFO messages from the abp SignalR client appearing on your Production site, plus anything else that uses abp.log.debug() or abp.log.info()

For further info, check the abp.js /* LOGGING section of the code, and also the source code for abp.signalr-client.js:

https://github.com/aspnetboilerplate/aspnetboilerplate-samples/blob/master/InterceptionDemo/InterceptionDemo.Web/Abp/Framework/scripts/libs/abp.signalr-client.js

ASP.NET Zero Version: 11.0.1 .NET 6 / Angular UI

I'm getting continual SignalR errors in the browser console - this happens both deployed to an Azure environment (with WebSockets enabled) and locally on my machine:

In the screenshot, you can see successful connections for both AppCommonHob/signalr and my projects-messaging hub.

When I use my projects-messaging hub on a long running background process, it communicates to the client for about 2 minutes, after which the client no longer gets any updates. No exceptions are thrown in the back-end though.

Can you offer any help with this please?

Showing 1 to 10 of 16 entries