Activities of "edirkzwager"

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

  • ABP Framework version: v4.1.1
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Seperated (Angular): yes
  • Exception message and stack trace: None
  • Steps to reproduce the issue: In order to use Telerik we have to remove the jquery and add it at the top of the page. This works al perfectly. We have found that jquery is still present/added at two screens of ABP itself namely Users and Organization Units. How to reproduce : Create a bundle contributor to remove JQuery like this :
	public class RemoveJqueryScriptContributor : BundleContributor
	{
		public override void ConfigureBundle(BundleConfigurationContext context)
		{
			context.Files.RemoveAll(x => x.StartsWith("/libs/jquery/jquery.js", StringComparison.InvariantCultureIgnoreCase));
		}
	}
Use this contributor in the webmodule like this :
			Configure<AbpBundlingOptions>(options =>
			{
				options
					.ScriptBundles
					.Configure("Lepton.Global", bundle =>
					{
						bundle.AddContributors(typeof(Support.RemoveJqueryScriptContributor));
					});
			});

Start the application and go to the Identity/Users screen and view the source. There you will find that the jquery.js is still there. However, if you go to the Identity/Roles you will find jquery.js is not there. We have noticed that both screens ( Users and Organization Units) also include jstree.js. I To me it seems the reported problem is somehow related to the use of jstree.js.

source of Users (incorrect) :

source of Organization Units (incorrect):

source of Roles (corrcect) :

Because we added jquery at the top of the page (wich works) the second added jquery.js by ABP itself will give a problem.

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

  • ABP Framework version: v2.8.0
  • UI type: ~~Angular~~ / MVC
  • Tiered (MVC) or Identity Server Seperated (Angular): yes / ~~no~~
  • Exception message and stack trace: n.a.
  • Steps to reproduce the issue: n.a.
  • After succesfully creating the tenant database using an override of the function CreateAsync, we now want to seed the new database with new permissions. I thought of using a Seeder but the docs on the Seeder subject contain : 'ToDo'

Could you explain to me hwo I should add the permissons we have defined in the PermissionDefinitionProvider in the Application.Contracts ? The code we use now to create the tenant database looks like this :

[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(ITenantAppService), typeof(KantanTenantAppService))]
public class KantanTenantAppService : TenantAppService
{
	private readonly ITenantRepository _tenantRepository;
	private readonly IEditionRepository _editionRepository;
	private readonly ITenantManager _tenantManager;
	private readonly IDataSeeder _dataSeeder;
	private readonly ICurrentTenant _currentTenant;
	private readonly IConfiguration _config;
	public KantanTenantAppService(ITenantRepository tenantRepository,
																IEditionRepository editionRepository,
																ITenantManager tenantManager,
																IDataSeeder dataSeeder,
																ICurrentTenant currentTenant,
																IConfiguration config) : base(
																tenantRepository,
																editionRepository,
																tenantManager,
																dataSeeder)
	{
		_tenantRepository = tenantRepository;
		_editionRepository = editionRepository;
		_tenantManager = tenantManager;
		_dataSeeder = dataSeeder;
		_currentTenant = currentTenant;
		_config = config;
	}
	[Authorize("Saas.Tenants.Create")]
	public override async Task&lt;SaasTenantDto&gt; CreateAsync(SaasTenantCreateDto input)
	{
		SaasTenantDto result;
		string configConnectionString = _config.GetConnectionString("NewTenantConnectionString");
		string newConnectionString = string.Empty;
		Tenant tenant;
		string dbPrefix = _config.GetSection(KantanConsts.TenantConfigSection)["Default"];

		result = await base.CreateAsync(input);
		tenant = _tenantRepository.FindByName(input.Name);
		if (tenant != null)
		{
			newConnectionString = 
				string.Format(configConnectionString
											,dbPrefix
											,tenant.Id.ToString().Replace("-","")
											);
			//Create default connection string for this new tenant
			await base.UpdateDefaultConnectionStringAsync(tenant.Id, newConnectionString);

			using (_currentTenant.Change(tenant.Id))
			{ 
				await ServiceProvider.
					GetRequiredService&lt;KantanDbMigrationService&gt;()
					.MigrateTenantDatabasesAsync(tenant);

				// Add the additional Permissions
				//addpermissions

				//Add other data
				//DoSomething
				
			}
		}
		return result;
	}
}

The definition provider for the permissions looks like this (in the application.contracts)

public class KantanPermissionDefinitionProvider : PermissionDefinitionProvider { public override void Define(IPermissionDefinitionContext context) { PermissionGroupDefinition KantanGroup = context.AddGroup(KantanPermissions.GroupName); PermissionDefinition pd;

  KantanGroup.AddPermission(KantanPermissions.Dashboard.Host, L("Permission:Dashboard"), MultiTenancySides.Host);
  KantanGroup.AddPermission(KantanPermissions.Dashboard.Tenant, L("Permission:Dashboard"), MultiTenancySides.Tenant);
  pd = KantanGroup.AddPermission(KantanPermissions.FinancialStatement.FinancialStatementGroup, L("Permission:FinancialStatementGroupName"), MultiTenancySides.Host);
  pd.AddChild(KantanPermissions.FinancialStatement.FinancialStatement_Add, L("Permission:Add"), MultiTenancySides.Host);
  pd.AddChild(KantanPermissions.FinancialStatement.FinancialStatement_Delete, L("Permission:Delete"), MultiTenancySides.Host);
  pd.AddChild(KantanPermissions.FinancialStatement.FinancialStatement_Edit, L("Permission:Edit"), MultiTenancySides.Host);
  pd.AddChild(KantanPermissions.FinancialStatement.FinancialStatement_Read, L("Permission:Read"), MultiTenancySides.Host);

}

private static LocalizableString L(string name)
{
  return LocalizableString.Create&lt;KantanResource&gt;(name);
}

}

Basically we have two questions : 1 : How to add the permissions ? 2 : How to add other data to the tenant database ?

Do we need to use a seeder ? Thanks for your help.

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

  • ABP Framework version: v2.8.0
  • UI type: ~~Angular ~~/ MVC
  • Tiered (MVC) ~~or Identity Server Seperated (Angular)~~: yes / ~~no~~
  • Exception message and stack trace: None
  • Steps to reproduce the issue:
  • We are trying to create the tenant database from within the aplication. First we override the CreateAsync function. Within that function we create the tenant and create a custom connection string. The last step we want to do is to create the database itself but here we are struggling. What is the correct and best way to call the migrator for the new tenant. The code below shows how we have currently tried to solve this. We added the dependancy to the DBmigrator and made the functions public so we can access it. We do not get any error, the database is just not created. The connecution string is called default and we only want to create the new database for the new tenant.
namespace Kantan
{
	[Dependency(ReplaceServices = true)]
	[ExposeServices(typeof(ITenantAppService), typeof(KantanTenantAppService))]
	public class KantanTenantAppService : TenantAppService
	{
		private readonly ITenantRepository _tenantRepository;
		private readonly IEditionRepository _editionRepository;
		private readonly ITenantManager _tenantManager;
		private readonly IDataSeeder _dataSeeder;
		public KantanTenantAppService(ITenantRepository tenantRepository,
        IEditionRepository editionRepository,
        ITenantManager tenantManager,
        IDataSeeder dataSeeder ) : base(
            tenantRepository,
            editionRepository,
            tenantManager,
            dataSeeder)
		{
			_tenantRepository = tenantRepository;
			_editionRepository = editionRepository;
			_tenantManager = tenantManager;
			_dataSeeder = dataSeeder;
		}
		[Authorize("Saas.Tenants.Create")]
		public override async Task<SaasTenantDto> CreateAsync(SaasTenantCreateDto input)
		{
			SaasTenantDto result;
			string newConnectionString = "";
			Tenant tenant;

			result = await base.CreateAsync(input);
			tenant = _tenantRepository.FindByName(input.Name);
			if (tenant!=null)
			{
				newConnectionString = $"Server=(LocalDb)\\MSSQLLocalDB;Database=Kantan{input.Name};Trusted_Connection=True;MultipleActiveResultSets=true";
				await base.UpdateDefaultConnectionStringAsync(tenant.Id, newConnectionString);

				//await ServiceProvider.
				//	GetRequiredService<KantanDbMigrationService>()
				//	.MigrateHostDatabaseAsync();
				await ServiceProvider.
					GetRequiredService<KantanDbMigrationService>()
					.MigrateTenantDatabasesAsync(tenant);
			}
			return result;
		}
	}
}

ABP Framework version: v2.7.0

  • UI type: MVC
  • Tiered (MVC) ~~or Identity Server Seperated (Angular)~~: yes
  • Exception message and stack trace: none
  • Steps to reproduce the issue:
  • We have a demo project (2.7 version) showcasing the issue. We migrated to 2.8 and still face the issue. To whom can I send the 2.7 project ?
  • As mentioned by alper the scriptbundle is altered (removal of jquery.js) in the web project.

Hi,

I have downloaded and created a tiered MVC application as instructed on the document pages. I am using the Commecrcial ABP ... so far so good. I have changed the appsettings.json to use localdb as below. "Default": "Server=(LocalDb)\MSSQLLocalDB;Database=Kantan;Trusted_Connection=True;MultipleActiveResultSets=true" Then I start the three projects within visual studio. (HttpApi.Host, IdentityServer and Web) I created the database using Migrations beforehand without any issues.

IdentityServers gives a blank page in the browser and the following error is logged in the log file :

2020-03-25 12:14:11.119 +01:00 [INF] Executed endpoint '/Account/Login' 2020-03-25 12:14:11.471 +01:00 [INF] Entity Framework Core 3.1.0 initialized 'AbpAuditLoggingDbContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer' with options: None 2020-03-25 12:14:11.810 +01:00 [INF] Executed DbCommand (13ms) [Parameters=[@p0='?' (DbType = Guid), @p1='?' (Size = 96), @p2='?' (Size = 512), @p3='?' (Size = 64), @p4='?' (Size = 64), @p5='?' (Size = 128), @p6='?' (Size = 256), @p7='?' (Size = 4000), @p8='?' (Size = 64), @p9='?' (Size = 4000), @p10='?' (DbType = Int32), @p11='?' (DbType = DateTime2), @p12='?' (Size = 4000), @p13='?' (Size = 16), @p14='?' (DbType = Int32), @p15='?' (DbType = Guid), @p16='?' (DbType = Guid), @p17='?' (DbType = Guid), @p18='?' (Size = 4000), @p19='?' (Size = 256), @p20='?' (DbType = Guid), @p21='?' (Size = 256)], CommandType='"Text"', CommandTimeout='30'] SET NOCOUNT ON; INSERT INTO [AbpAuditLogs] ([Id], [ApplicationName], [BrowserInfo], [ClientId], [ClientIpAddress], [ClientName], [Comments], [ConcurrencyStamp], [CorrelationId], [Exceptions], [ExecutionDuration], [ExecutionTime], [ExtraProperties], [HttpMethod], [HttpStatusCode], [ImpersonatorTenantId], [ImpersonatorUserId], [TenantId], [TenantName], [Url], [UserId], [UserName]) VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9, @p10, @p11, @p12, @p13, @p14, @p15, @p16, @p17, @p18, @p19, @p20, @p21); 2020-03-25 12:14:11.882 +01:00 [DBG] Added 0 entity changes to the current audit log 2020-03-25 12:14:11.882 +01:00 [DBG] Added 0 entity changes to the current audit log 2020-03-25 12:14:11.898 +01:00 [ERR] Connection ID "17798225737568747535", Request ID "80000010-0002-f700-b63f-84710c7967bb": An unhandled exception was thrown by the application. System.NullReferenceException: Object reference not set to an instance of an object. at AspNetCore._Themes_Lepton_Components_Toolbar_LanguageSwitch_Default.ExecuteAsync() in /Themes/Lepton/Components/Toolbar/LanguageSwitch/Default.cshtml:line 5 at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context) at Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult.ExecuteAsync(ViewComponentContext context) at Microsoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentInvoker.InvokeAsync(ViewComponentContext context) at Microsoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentHelper.InvokeCoreAsync(ViewComponentDescriptor descriptor, Object arguments) at Volo.Abp.AspNetCore.Mvc.UI.Widgets.AbpViewComponentHelper.InvokeAsync(Type componentType, Object arguments) at AspNetCore._Themes_Lepton_Layouts_Account_Default.<>c__DisplayClass17_0.<<ExecuteAsync>b__7>d.MoveNext() in /Themes/Lepton/Layouts/Account/Default.cshtml:line 81 --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync() at AspNetCore._Themes_Lepton_Layouts_Account_Default.<>c__DisplayClass17_0.<<ExecuteAsync>b__3>d.MoveNext() in /Themes/Lepton/Layouts/Account/Default.cshtml:line 68 --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync() at AspNetCore._Themes_Lepton_Layouts_Account_Default.<>c__DisplayClass17_0.<<ExecuteAsync>b__1>d.MoveNext() in /Themes/Lepton/Layouts/Account/Default.cshtml:line 66 --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync() at AspNetCore._Themes_Lepton_Layouts_Account_Default.ExecuteAsync() in /Themes/Lepton/Layouts/Account/Default.cshtml:line 34 at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderLayoutAsync(ViewContext context, ViewBufferTextWriter bodyWriter) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable1 statusCode) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable1 statusCode) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|29_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeResultFilters>g__Awaited|27_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass5_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass5_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events) at IdentityServer4.Hosting.MutualTlsTokenEndpointMiddleware.Invoke(HttpContext context, IAuthenticationSchemeProvider schemes) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at IdentityServer4.Hosting.BaseUrlMiddleware.Invoke(HttpContext context) at Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass5_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass5_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT`1.ProcessRequestAsync() 2020-03-25 12:14:11.973 +01:00 [INF] Request finished in 8996.1172ms 500

Am I doing something wrong ?

Showing 1 to 5 of 5 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11