Base solution for your next web application

Activities of "JapNolt"

I have downloaded the Angular/aspnetcore template (not merged) and I would like to deploy both to the same Azure App Service. How can I make that work? I'm assuming there are things I need to configure in the web.config and also maybe in the Azure App Service to make it work??

Is it possible to change the default host tenant name to something that's hard to discover, ie. thisismysuperhardtenantname.portal.mycoolwebsite.com. The host tenant name would be required. In other words, a user could NOT go to portal.mycoolwebsite.com to login to the default host tenant.

I'm using ASPNetCore and Angular project. My host appsettings.json:

"App": {
    "ServerRootAddress": "http://{TENANCY_NAME}.api.mycoolwebsite.com",
    "ClientRootAddress": "http://{TENANCY_NAME}.portal.mycoolwebsite.com",
    "CorsOrigins": "http://portal.mycoolwebsite.com"
  }

My Angular appconfig.json

"remoteServiceBaseUrl": "http://{TENANCY_NAME}.api.mycoolwebsite.com",
  "appBaseUrl": "http://{TENANCY_NAME}.portal.mycoolwebsite.com",
Question

using angular and aspnet core template

Does anybody have any guidance or samples on keeping the data in an angular component live? In other words when a record gets created in a backend table, I want the service to notify the angular UI that it needs to update/refresh. I know that signalr is the tool to use but I'm looking for guidance on best code structure.

In addition to our web site we have a WPF client application for our users. We want them to be able to sign up from our client app, and we would like to require re-captcha.

The problem is I can't figure out how to display a re-captcha in our client app so I can send a code along with the request to register an account. I have tried to load a page in the WPF web browser control but the re-captcha doesn't display in the page (when it does in a browser).

Would you be able to help me figure out a way to get a re-captcha code that I could send along with my request to register an account?

We are using ASP.Net Core and Angular project. We've set the project to use the UTC Clock Provider. The examples I'm going to give use the built-in Audit Logs. I've patterned some of my other data grids and filters off of this and they're suffering the same problem.

All audit logs in the db is being saved as UTC time. When shown in the Angular UI, the audit logs are showing correctly in the TimeZone that the user has selected (in my case EST, which is GMT -5). This is all good. But when the user selects a date range to filter the audit logs, the dates sent are the "local time".

So if the user selects to show audit logs from 2018/01/26, the filters are sent to the backend as 2018/01/26 00:00:00 - 2018/01/26 23:59:59. When the data is returned, there could be some audit logs with a date of 2016/01/25 which is not what the user would expect. Instead, the date range that is sent to the app service should be in UTC which in my case would be 2018/01/25 19:00:00 - 2018/01/26 18:59:59.

Am I missing some config on the Angular side or is the date range picker not being initialized correctly with the time zone offset?

Question

I would like to see a user-based licensing model similar to viewtopic.php?t=3369. The tenant would purchase x number of licenses of a certain edition. Those licenses would then be assigned to users up to the number purchased. Something very similar to Microsoft Office 365.

Any plans to do something like this?

Question

We were having an issue where we would make a change to a css class for an element and after deploying the code the changes did not show unless you did a Ctrl + F5 to prevent loading from the cache.

We discovered the index.html file was being cached which was why we did not see our changes when doing a typical refresh. We found a fix which involves modifying the web.config file to not cache the index.html file like this:

<location path="index.html">
<system.webServer>
  <staticContent>
    <clientCache cacheControlMode="DisableCache" cacheControlMaxAge="0.00:00:00" />
  </staticContent>
    <httpProtocol>
        <customHeaders>
            <add name="Cache-Control" value="no-cache, no-store, must-revalidate" />
            <add name="Pragma" value="no-cache" />
            <add name="Expires" value="-1" />
        </customHeaders>
    </httpProtocol>  
</system.webServer>
</location>

This seems to work, however I was wondering if you have any guidance if this is a recommended practice, or is there a better way to prevent the caching of the index.html file?

I want to track when certain clients (desktop clients) connect/disconnect from SignalR. I want to log each connect/disconnect in a database table. The question is specifically about writing to the database from inside an event. Can anybody think of a problem with doing it this way? Db contention, etc. Is there a preferred/better way?

using Abp.Dependency;
using Abp.Domain.Repositories;
using Abp.RealTime;
using MyProject.Timeline;

namespace MyProject.RealTimeCommand
{
    public class ClientStateWatcher : ISingletonDependency
    {
        private readonly IOnlineClientManager _onlineClientManager;
        private readonly IRepository<ClientStatus, long> _clientStatusRepository;

        public ClientStateWatcher(
                IOnlineClientManager onlineClientManager
                , IRepository<ClientStatus, long> clientStatusRepository
            )
        {
            _onlineClientManager = onlineClientManager;
            _clientStatusRepository = clientStatusRepository;
        }

        public void Initialize()
        {
            _onlineClientManager.ClientConnected += _onlineClientManager_ClientConnected;
            _onlineClientManager.ClientDisconnected += _onlineClientManager_ClientDisconnected;
        }

        private void _onlineClientManager_ClientConnected(object sender, OnlineClientEventArgs e)
        {
            TrackClientStatusChange(e.Client, true);
        }

        private void _onlineClientManager_ClientDisconnected(object sender, OnlineClientEventArgs e)
        {
            TrackClientStatusChange(e.Client, false);
        }

        private void TrackClientStatusChange(IOnlineClient onlineClient, bool connected)
        {
            if ((string)onlineClient.Properties.GetValueOrDefault(OccConsts.HttpHeader_ClientType) == "DesktopClient")
            {
            _clientStatusRepository.Insert(
                new ClientStatus
                {
                    Status = connected ? ConnectionState.ConnectedOrSignedIn : ConnectionState.DisconnectedOrSignedOut,
                    CreatorUserId = onlineClient.UserId,
                    TenantId = onlineClient.TenantId.Value
                });
            }
        }
    }
}

I would like to have separate password complexity settings for the host vs tenants, namely I want the host to have a high complexity (with maybe 2FA) but the tenants would have the default password complexity, which is not as high.

Currently in the framework, if the host sets a high complexity, then every tenant also has a high complexity unless the tenant changes it.

I am getting a System.OutOfMemoryException when running tests. I've had it happen both on my dev machine and in my build pipeline in VSTS. It happens when I run all the tests but if I run a failing test by itself, it works. If I watch testhost_x86.exe memory consumption, I see it steadily increase. I first had this happen in my main project so I downloaded a clean project, duplicated the built-in tests several times, and the problem has occured. I used JetBrains dotMemory to monitor memory usage and it appears that when the exception occurs, most of the process's memory is unmanaged memory.

Showing 1 to 10 of 20 entries