Base solution for your next web application

Activities of "devkev2403"

I am running ABP MVC .Net Core on a web farm behind a load balancer. I use SignalR for notifications. After logging in attempts are made to initiate a SignalR connection. In the browser dev tools you can see the activity:

/signalr/connect?transport=serverSentEvents&clientProtocol=1.5&connectionToken=xxx&connectionData=%5B%7B%22name%22%3A%22abpcommonhub%22%7D%2C%7B%22name%22%3A%22chathub%22%7D%5D&tid=6

However, this gives a 400 with the following error: The ConnectionId is in the incorrect format.

Following advice from other sources: I have shared .NET Core data protection keys in Redis. IIS has defined machine keys so these are the same on all servers. The app pools are set to run as the same domain user.

Can you help me discover what I have missed please.

Thanks

Hi,

I want to write my own WebAPI based on the documentation here:

<a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Web-API-Controllers">https://aspnetboilerplate.com/Pages/Doc ... ontrollers</a>

However, the nuget package is not for .NET Core. Is there a different approach for .NET Core?

Thanks

Hi,

I am trying to trigger EF migrations using Dtabase.Migrate.

I have used this code as a reference: <a class="postlink" href="https://stackoverflow.com/questions/45123604/ef-core-migration-with-aspnetboilerplate-where-to-trigger-context-database-migra">https://stackoverflow.com/questions/451 ... base-migra</a>

But I think migration should take place before seeding - seeding may need new schema!

Currently I do this:

public class MyEntityFrameworkCoreModule : AbpModule
{
        /* Used it tests to skip dbcontext registration, in order to use in-memory database of EF Core */
        public bool SkipDbContextRegistration { get; set; }

        public bool SkipDbSeed { get; set; }

        public override void PreInitialize()
        {
            if (!SkipDbContextRegistration)
            {
                Configuration.Modules.AbpEfCore().AddDbContext<MyDbContext>(options =>
                {
                    if (options.ExistingConnection != null)
                    {
                        MyDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
                    }
                    else
                    {
                        MyDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
                    }
                });
            }
        }

        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(typeof(MyEntityFrameworkCoreModule).GetAssembly());
        }

        public override void PostInitialize()
        {
          // THIS IS WHERE I DO MIGRATIONS
            EnsureMigrated();

            if (!SkipDbSeed)
            {
                SeedHelper.SeedHostDb(IocManager);
            }

            
        }

        private void EnsureMigrated()
        {
           // THIS IS HOW SeedHelper DOES IT
            using (var uowManager = IocManager.ResolveAsDisposable<IUnitOfWorkManager>())
            {
                using (var uow = uowManager.Object.Begin(TransactionScopeOption.Suppress))
                {
                    var context = uowManager.Object.Current.GetDbContext<MyDbContext>(MultiTenancySides.Host);

                    context.Database.Migrate();

                    uow.Complete();
                }
            }
        }

However, this code throws an exception: connection is already in a transaction and cannot participate in another transaction

Any help appreciated.

Hi,

I have an ASP.NET Module Zero application (ASP.NET Core targetting .NET 4.6) that runs on multiple servers. The servers are behind a load balancer.

The application publishes a notification. The application is configured to use Redis (and it's pub/sub model) as a backplane. The idea here is that the notification from the server gets written to the Redis backplane, the Redis backplane then notifies all the other servers (that are Redis subscribers) and the other servers then using the ABP Zero notification system send the notification to all it's connected clients using SignalR.

Publishing the notification is ok and it gets written/published to the Redis backplane. All servers/subscribers get the Redis message ok (I can see it using redis-cli). The problem I have is that only the clients connected to 1 server get a SignalR message to act on (e.g. display a model and update the notification count in the top right corner).

I know this is a needle in a hay stack, but am I missing some obvious configuration step that would cause this?

Thanks

Kevin

Please can you offer me some guidance. I have Ldap Authentication working as per the instructions in the documentation (although I had to update db schema to allow columns AbpUsers.EmailAddress and AbpUsers.NormalizedEmailAddress to be null).

However, I would like to use SSO.

I am using .NET Core. Can you point me in the right direction of any useful resources please?

Thanks

I can not save users in the admin back office (for example, I can not assign roles). When I try to save a user I get a pop up error message.

The modal does indeed call the UserAppService - CreateOrUpdateUser

This error is written to the log file:

ERROR 2017-10-03 16:50:06,694 [44 ] ud.EntityFramework.UtilityCloudDbContext - There are some validation errors while saving changes in EntityFramework: ERROR 2017-10-03 16:50:06,694 [44 ] ud.EntityFramework.UtilityCloudDbContext - - Password: The Password field is required.

Is this a bug that has since been fixed?

Question

Hi,

how exactly should the "Remember Me" checkbox on the login page work?

Currently I use a cookie so ticking or unticking the checkbox makes no difference. If the user does not explicitly logout, the next time they open their browser they are automatically logged in. This is not what I want.

Thanks

I am trying to implement custom error pages but think in the BoilerPlate Framework (MVC5/jQuery MPA) ASP.NET is handling static file requests.

For example, if I specify ASP.NET custom errors in web.config:

<customErrors mode="On" redirectMode="ResponseRewrite">
  <error statusCode="404" redirect="/Errors/404.aspx"/>
</customErrors>

and visit a controller that does not exist, my.website.com/nullcontroller/nullaction, I correctly get the ASP.NET 404 page 404.aspx.

Now, I can also configure IIS custom errors in web.config:

<system.webServer>
	
	<httpErrors errorMode="Custom">  
		<remove statusCode="404"/>
		<error statusCode="404" path="Errors\404.html" responseMode="File"/>
	</httpErrors>
  </system.webServer>

However now, if I visit a non-existing page like my.website.com/notexist.html I still get the ASP.NET 404.aspx error page, not the IIS 404.html error page. ASP.NET is trying to server the static file and can't find it so returns the ASP.NET 404 page. Normally IIS would handle the static file request and use the IIS 404 page.

I prove this to myself by modifying the routes in RouteConfig.cs and adding a route to explicitly ignore the notexist.html static file.

public static void RegisterRoutes(RouteCollection routes)
{
  routes.IgnoreRoute("notexist.html");  // My test URL
  routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  ...
  ...

Now if I visit my.website.com/notexist I get the intended page, the IIS 404.html error page. ASP.NET did not attempt to handle the static file request. Instead IIS attempted to find the file and failed so served it's 404 page.

I am just wondering, how is BoilerPlate configured (e.g. where in the code/config) such that html files are handled by ASP.NET and not IIS. By default, in the sample Visual Studio MVC application, static files are handled by IIS.

I did find this interesting code in the ABP source in class Abp.Web.Mvc.Controllers.AbpController in the OnException method:

context.HttpContext.Response.TrySkipIisCustomErrors = true;

but changing this to false did not have any affect.

Thanks

Showing 1 to 8 of 8 entries