I've just used the latest version to create new CRM app using the template (Blazor server) however didn't received such error. Can you post additional info on how to reproduce this?
I've managed to reproduce this however - it's caused by the additional partial class in the page (there is similar in other security pages since we share code between out templates). To fix it move the SecurityService declaration inside the main class and delete the additional partial class:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.JSInterop;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using Radzen;
using Radzen.Blazor;
namespace CRMNew.Components.Pages
{
public partial class AddApplicationRole
{
[Inject]
protected IJSRuntime JSRuntime { get; set; }
[Inject]
protected NavigationManager NavigationManager { get; set; }
[Inject]
protected DialogService DialogService { get; set; }
[Inject]
protected TooltipService TooltipService { get; set; }
[Inject]
protected ContextMenuService ContextMenuService { get; set; }
[Inject]
protected NotificationService NotificationService { get; set; }
[Inject]
protected SecurityService Security { get; set; }
protected CRMNew.Models.ApplicationRole role;
protected string error;
protected bool errorVisible;
protected override async Task OnInitializedAsync()
{
role = new CRMNew.Models.ApplicationRole();
}
protected async Task FormSubmit(CRMNew.Models.ApplicationRole role)
{
try
{
await Security.CreateRole(role);
DialogService.Close(null);
}
catch (Exception ex)
{
errorVisible = true;
error = ex.Message;
}
}
protected async Task CancelClick()
{
DialogService.Close(null);
}
}
}
We will fix our template in our next update.