Base solution for your next web application

Activities of "paulg"

I guess newbie questions aren't answered. Fixed this by moving the below line to the right place:

new AppMenuItem('Games', 'Pages.Games', 'flaticon-more', '/app/main/games/games'),

Not sure why it was placed on top.

Something looks wrong at the beginning of the file.

        new AppMenuItem('Games', 'Pages.Games', 'flaticon-more', '/app/main/games/games'),
        import { PermissionCheckerService } from 'abp-ng2-module';

import { AppSessionService } from '@shared/common/session/app-session.service';

import { Injectable } from '@angular/core'; import { AppMenu } from './app-menu'; import { AppMenuItem } from './app-menu-item';

@Injectable() export class AppNavigationService { constructor( private _permissionCheckerService: PermissionCheckerService, private _appSessionService: AppSessionService ) {}

getMenu(): AppMenu {
    return new AppMenu('MainMenu', 'MainMenu', [
        new AppMenuItem(
            'Dashboard',
            'Pages.Administration.Host.Dashboard',
            'flaticon-line-graph',
            '/app/admin/hostDashboard'
        ),
        new AppMenuItem('Dashboard', 'Pages.Tenant.Dashboard', 'flaticon-line-graph', '/app/main/dashboard'),
        new AppMenuItem('Tenants', 'Pages.Tenants', 'flaticon-list-3', '/app/admin/tenants'),
        new AppMenuItem('Editions', 'Pages.Editions', 'flaticon-app', '/app/admin/editions'),
        new AppMenuItem(
            'Administration',
            '',
            'flaticon-interface-8',
            '',
            [],
            [
                new AppMenuItem(
                    'OrganizationUnits',
                    'Pages.Administration.OrganizationUnits',
                    'flaticon-map',
                    '/app/admin/organization-units'
                ),
                new AppMenuItem('Roles', 'Pages.Administration.Roles', 'flaticon-suitcase', '/app/admin/roles'),
                new AppMenuItem('Users', 'Pages.Administration.Users', 'flaticon-users', '/app/admin/users'),
                new AppMenuItem(
                    'Languages',
                    'Pages.Administration.Languages',
                    'flaticon-tabs',
                    '/app/admin/languages',
                    ['/app/admin/languages/{name}/texts']
                ),
                new AppMenuItem(
                    'AuditLogs',
                    'Pages.Administration.AuditLogs',
                    'flaticon-folder-1',
                    '/app/admin/auditLogs'
                ),
                new AppMenuItem(
                    'Maintenance',
                    'Pages.Administration.Host.Maintenance',
                    'flaticon-lock',
                    '/app/admin/maintenance'
                ),
                new AppMenuItem(
                    'Subscription',
                    'Pages.Administration.Tenant.SubscriptionManagement',
                    'flaticon-refresh',
                    '/app/admin/subscription-management'
                ),
                new AppMenuItem(
                    'VisualSettings',
                    'Pages.Administration.UiCustomization',
                    'flaticon-medical',
                    '/app/admin/ui-customization'
                ),
                new AppMenuItem(
                    'WebhookSubscriptions',
                    'Pages.Administration.WebhookSubscription',
                    'flaticon2-world',
                    '/app/admin/webhook-subscriptions'
                ),
                new AppMenuItem(
                    'DynamicProperties',
                    'Pages.Administration.DynamicProperties',
                    'flaticon-interface-8',
                    '/app/admin/dynamic-property'
                ),
                new AppMenuItem(
                    'Settings',
                    'Pages.Administration.Host.Settings',
                    'flaticon-settings',
                    '/app/admin/hostSettings'
                ),
                new AppMenuItem(
                    'Settings',
                    'Pages.Administration.Tenant.Settings',
                    'flaticon-settings',
                    '/app/admin/tenantSettings'
                ),
            ]
        ),
        new AppMenuItem(
            'DemoUiComponents',
            'Pages.DemoUiComponents',
            'flaticon-shapes',
            '/app/admin/demo-ui-components'
        ),
    ]);
}

checkChildMenuItemPermission(menuItem): boolean {
    for (let i = 0; i < menuItem.items.length; i++) {
        let subMenuItem = menuItem.items[i];

        if (subMenuItem.permissionName === '' || subMenuItem.permissionName === null) {
            if (subMenuItem.route) {
                return true;
            }
        } else if (this._permissionCheckerService.isGranted(subMenuItem.permissionName)) {
            return true;
        }

        if (subMenuItem.items && subMenuItem.items.length) {
            let isAnyChildItemActive = this.checkChildMenuItemPermission(subMenuItem);
            if (isAnyChildItemActive) {
                return true;
            }
        }
    }
    return false;
}

showMenuItem(menuItem: AppMenuItem): boolean {
    if (
        menuItem.permissionName === 'Pages.Administration.Tenant.SubscriptionManagement' &&
        this._appSessionService.tenant &&
        !this._appSessionService.tenant.edition
    ) {
        return false;
    }

    let hideMenuItem = false;

    if (menuItem.requiresAuthentication && !this._appSessionService.user) {
        hideMenuItem = true;
    }

    if (menuItem.permissionName && !this._permissionCheckerService.isGranted(menuItem.permissionName)) {
        hideMenuItem = true;
    }

    if (this._appSessionService.tenant || !abp.multiTenancy.ignoreFeatureCheckForHostUsers) {
        if (menuItem.hasFeatureDependency() && !menuItem.featureDependencySatisfied()) {
            hideMenuItem = true;
        }
    }

    if (!hideMenuItem && menuItem.items && menuItem.items.length) {
        return this.checkChildMenuItemPermission(menuItem);
    }

    return !hideMenuItem;
}

/**
 * Returns all menu items recursively
 */
getAllMenuItems(): AppMenuItem[] {
    let menu = this.getMenu();
    let allMenuItems: AppMenuItem[] = [];
    menu.items.forEach((menuItem) => {
        allMenuItems = allMenuItems.concat(this.getAllMenuItemsRecursive(menuItem));
    });

    return allMenuItems;
}

private getAllMenuItemsRecursive(menuItem: AppMenuItem): AppMenuItem[] {
    if (!menuItem.items) {
        return [menuItem];
    }

    let menuItems = [menuItem];
    menuItem.items.forEach((subMenu) => {
        menuItems = menuItems.concat(this.getAllMenuItemsRecursive(subMenu));
    });

    return menuItems;
}

}

I have a brand new demo project on ASP.NET CORE & Angular (single solution) .NET 5.0 v10.5.0. Started up fine and I got to the UI. After I used PowerTools to create an entity with two fields, I get this when running npm start (see image). Database table is created. Refresh.bat didn't help. What is the problem here?

I have a brand new web solution. ASP.NET CORE & Angular (single solution) .NET 5.0 v10.3.0. When I open web.sln and run npm start and go to localhost:4200, the application will just spin and will not open the starting page (Dashboard). It will only load if I run Web.host to open localhost:44301/Ui and login. After that the Dashbaord will load. Is this the way it works?

This was resolved by installing VS 2019, from VS 2017.

I dowloaded and opened ASP.NET CORE & Angular (single solution) with .NET 5.0 and v10.3.0 yesterday. I'm seeing these errors after opening Web.sln:

  • NU1202 Package IdentityServer4 4.1.1 is not compatible with net50 (.NETFramework,Version=v5.0) / win7-x86. Package IdentityServer4 4.1.1 supports: netcoreapp3.1 (.NETCoreApp,Version=v3.1)
  • NU1202 Package IdentityServer4 4.1.1 is not compatible with net50 (.NETFramework,Version=v5.0). Package IdentityServer4 4.1.1 supports: netcoreapp3.1 (.NETCoreApp,Version=v3.1)
  • NU1202 Package IdentityServer4.AccessTokenValidation 3.0.1 is not compatible with net50 (.NETFramework,Version=v5.0) / win7-x86. Package IdentityServer4.AccessTokenValidation 3.0.1 supports: netcoreapp3.0 (.NETCoreApp,Version=v3.0)
  • NU1202 Package IdentityServer4.AspNetIdentity 4.1.1 is not compatible with net50 (.NETFramework,Version=v5.0) / win7-x86. Package IdentityServer4.AspNetIdentity 4.1.1 supports: netcoreapp3.1 (.NETCoreApp,Version=v3.1)
  • MSB3644 The reference assemblies for framework ".NETFramework,Version=v5.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.

.Net should be installed: C:\WINDOWS\system32>dotnet --list-sdks 2.1.403 [C:\Program Files\dotnet\sdk] 2.1.502 [C:\Program Files\dotnet\sdk] 2.2.101 [C:\Program Files\dotnet\sdk] 5.0.202 [C:\Program Files\dotnet\sdk]

Please let me know what could be wrong.

Hi, what should be the Connection String when using the RAD Tool > Load Entity From Database? I have tried using the same as in appsettings.json and other variations, but it does not connect:

Server=.\SQLEXPRESS; Database=TestDB; Trusted_Connection=True;

I only get Instance Failure error.

Question

I have ASP.NET CORE MVC & jQuery with .NET Framework 4.6.1 on ASP.NET Zero version 6.2.1 up and running. I have added some entities with the RAD tool to test out a few things. I tried to upgrade to ASP.NET Zero 6.4.0, and did this by copying and pasting all files from 6.4.0 to my 6.2.1 files in Windows Explorer, overwriting any files in conflict. I realize this would probably break the entities I added with the RAD tool, but as a test, I expected at least to be up and running on 6.4.0 without the entities I added.

After copying over the files, I ran yarn, Update-Database, and npm run create-bundles.

Shouldn't this work (meaning get 6.4.0 working)?

I get these build errors:

Severity	Code	Description	Project	File	Line	Suppression State
Error	CS0117	'AppSettings.UserManagement' does not contain a definition for 'IsCookieConsentEnabled'	XYZ.WER.Application	D:\WER\src\XYZ.WER.Application\Configuration\Host\HostSettingsAppService.cs	94	Active
Error	CS0117	'AppSettings.UserManagement' does not contain a definition for 'IsCookieConsentEnabled'	XYZ.WER.Application	D:\WER\src\XYZ.WER.Application\Configuration\Host\HostSettingsAppService.cs	248	Active
Error	CS0117	'AppSettings.UserManagement' does not contain a definition for 'IsCookieConsentEnabled'	XYZ.WER.Application	D:\WER\src\XYZ.WER.Application\Configuration\Tenants\TenantSettingsAppService.cs	136	Active
Error	CS0117	'AppSettings.UserManagement' does not contain a definition for 'IsCookieConsentEnabled'	XYZ.WER.Application	D:\WER\src\XYZ.WER.Application\Configuration\Tenants\TenantSettingsAppService.cs	312	Active
Warning	MSB3245	Could not resolve this reference. Could not locate the assembly "System.ComponentModel.DataAnnotations". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.	XYZ.WER.Core.Shared	C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets	2110	
Warning	MSB3245	Could not resolve this reference. Could not locate the assembly "System.ComponentModel.DataAnnotations". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.	XYZ.WER.Application.Shared	C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets	2110	
Error	CS0579	Duplicate 'Area' attribute	XYZ.WER.Web.Mvc	D:\WER\src\XYZ.WER.Web.Mvc\Areas\App\Controllers\CommonController.cs	8	Active
Error	CS0101	The namespace 'XYZ.WER.Identity' already contains a definition for 'ISmsSender'	XYZ.WER.Core	D:\WER\src\XYZ.WER.Core\Net\Sms\ISmsSender.cs	5	Active
Error	CS0101	The namespace 'XYZ.WER.Web.Areas.App.Controllers' already contains a definition for 'CommonController'	XYZ.WER.Web.Mvc	D:\WER\src\XYZ.WER.Web.Mvc\Areas\App\Controllers\CommonController.cs	10	Active
Error	CS0101	The namespace 'XYZ.WER.Web.Areas.App.Views.Shared.Components.AppDefaultBrand' already contains a definition for 'AppDefaultBrandViewComponent'	XYZ.WER.Web.Mvc	D:\WER\src\XYZ.WER.Web.Mvc\Areas\App\Views\Shared\Components\AppDefaultBrand\AppDefaultBrandViewComponent.cs	9	Active
Warning	CS0472	The result of the expression is always 'true' since a value of type 'int' is never equal to 'null' of type 'int?'	XYZ.WER.Application	D:\WER\src\XYZ.WER.Application\Activities\ActivitiesAppService.cs	78	Active
Warning	CS0472	The result of the expression is always 'true' since a value of type 'int' is never equal to 'null' of type 'int?'	XYZ.WER.Application	D:\WER\src\XYZ.WER.Application\Contacts\ContactsAppService.cs	81	Active
Warning	CS0472	The result of the expression is always 'true' since a value of type 'int' is never equal to 'null' of type 'int?'	XYZ.WER.Application	D:\WER\src\XYZ.WER.Application\Opportunities\OpportunitiesAppService.cs	77	Active
Warning	CS0472	The result of the expression is always 'true' since a value of type 'int' is never equal to 'null' of type 'int?'	XYZ.WER.Application	D:\WER\src\XYZ.WER.Application\ServiceRequests\ServiceRequestsAppService.cs	77	Active
Error	CS0246	The type or namespace name 'IUiCustomizer' could not be found (are you missing a using directive or an assembly reference?)	XYZ.WER.Web.Core	D:\WER\src\XYZ.WER.Web.Core\UiCustomization\Metronic\Theme11UiCustomizer.cs	11	Active
Error	CS0246	The type or namespace name 'IUiCustomizer' could not be found (are you missing a using directive or an assembly reference?)	XYZ.WER.Web.Core	D:\WER\src\XYZ.WER.Web.Core\UiCustomization\Metronic\Theme2UiCustomizer.cs	11	Active
Error	CS0246	The type or namespace name 'IUiCustomizer' could not be found (are you missing a using directive or an assembly reference?)	XYZ.WER.Web.Core	D:\WER\src\XYZ.WER.Web.Core\UiCustomization\Metronic\Theme3UiCustomizer.cs	11	Active
Error	CS0246	The type or namespace name 'IUiCustomizer' could not be found (are you missing a using directive or an assembly reference?)	XYZ.WER.Web.Core	D:\WER\src\XYZ.WER.Web.Core\UiCustomization\Metronic\Theme7UiCustomizer.cs	11	Active
Error	CS0246	The type or namespace name 'IUiCustomizer' could not be found (are you missing a using directive or an assembly reference?)	XYZ.WER.Web.Core	D:\WER\src\XYZ.WER.Web.Core\UiCustomization\Metronic\Theme8UiCustomizer.cs	11	Active
Error	CS0246	The type or namespace name 'IUiCustomizer' could not be found (are you missing a using directive or an assembly reference?)	XYZ.WER.Web.Core	D:\WER\src\XYZ.WER.Web.Core\UiCustomization\Metronic\ThemeDefaultUiCustomizer.cs	11	Active
Error	CS0246	The type or namespace name 'IUiCustomizer' could not be found (are you missing a using directive or an assembly reference?)	XYZ.WER.Web.Core	D:\WER\src\XYZ.WER.Web.Core\UiCustomization\UiThemeCustomizerFactory.cs	24	Active
Error	CS0246	The type or namespace name 'IUiCustomizer' could not be found (are you missing a using directive or an assembly reference?)	XYZ.WER.Web.Core	D:\WER\src\XYZ.WER.Web.Core\UiCustomization\UiThemeCustomizerFactory.cs	30	Active
Error	CS0246	The type or namespace name 'IUiCustomizer' could not be found (are you missing a using directive or an assembly reference?)	XYZ.WER.Web.Core	D:\WER\src\XYZ.WER.Web.Core\UiCustomization\UiThemeCustomizerFactory.cs	35	Active
Error	CS0246	The type or namespace name 'IUiThemeCustomizerFactory' could not be found (are you missing a using directive or an assembly reference?)	XYZ.WER.Web.Core	D:\WER\src\XYZ.WER.Web.Core\UiCustomization\UiThemeCustomizerFactory.cs	11	Active
Error	CS0246	The type or namespace name 'IUiThemeCustomizerFactory' could not be found (are you missing a using directive or an assembly reference?)	XYZ.WER.Web.Mvc	D:\WER\src\XYZ.WER.Web.Mvc\Views\WERRazorPage.cs	16	Active
Error	CS0234	The type or namespace name 'Swagger' does not exist in the namespace 'XYZ.WER.Web' (are you missing an assembly reference?)	XYZ.WER.Web.Mvc	D:\WER\src\XYZ.WER.Web.Mvc\Startup\Startup.cs	42	Active
Error	CS0111	Type 'CommonController' already defines a member called 'LookupModal' with the same parameter types	XYZ.WER.Web.Mvc	D:\WER\src\XYZ.WER.Web.Mvc\Areas\App\Controllers\CommonController.cs	12	Active
Error	CS0111	Type 'ISmsSender' already defines a member called 'SendAsync' with the same parameter types	XYZ.WER.Core	D:\WER\src\XYZ.WER.Core\Net\Sms\ISmsSender.cs	7	Active

I do get ASP-NET Zero version 6.4.0 working by itself just fine, but not when copying over all the files to my existing 6.2.1 solution.

Great, thank you! This works now.

Showing 1 to 10 of 28 entries