أنشطة "raif"

Hi, I have created a separate database for each tenant in order to provide data isolation between host and tenant in my system. Migration operation is performed over different contextes

Host is

    /* Include modules to your migration db context */
    builder.ConfigurePermissionManagement();
    builder.ConfigureSettingManagement();
    builder.ConfigureBackgroundJobs();
    builder.ConfigureAuditLogging();
    builder.ConfigureIdentity();
    builder.ConfigureIdentityServer();
    builder.ConfigureFeatureManagement();
    builder.ConfigureLanguageManagement();
    builder.ConfigureSaas();
    builder.ConfigureTextTemplateManagement();
    builder.ConfigureBlobStoring();
    /* Custom platform modules */         
    builder.ConfigureCredit();
    /* Configure your own tables/entities inside the ConfigureNMM method */
    builder.ConfigureNMM();

Tenat is

    builder.ConfigurePermissionManagement();
    builder.ConfigureSettingManagement();
    builder.ConfigureAuditLogging();
    builder.ConfigureIdentity();
    builder.ConfigureFeatureManagement();
    builder.ConfigureLanguageManagement();
    builder.ConfigureTextTemplateManagement();

As you can see from above we didn't create any identityServer4 related table at tenant side since it is host related task

As far as i can see out of box app client supports password grant flow

   CreateClientAsync(
    name: consoleAndAngularClientId,
    scopes: commonScopes,
    grantTypes: new[] { "password", "client_credentials", "authorization_code" },
    secret: (configurationSection["XYZ_App:ClientSecret"] ?? "1q2w3e*").Sha256(),
    requireClientSecret: ~~false~~ true,
    redirectUri: webClientRootUrl,
    postLogoutRedirectUri: webClientRootUrl,
~~corsOrigins: new[] { webClientRootUrl.RemovePostFix("/") ~~

Ofcourse, there is no problem for the host users

However tenant users are not able get token for the API calls, Any hint ?

  • ABP Framework version: v4.2.1
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:
  • ABP Framework version: v4.2.1
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes

https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Overriding-Services

Hello, I want to override the method in the application service which in a seperate module.

using Volo.Saas.Editions;
using Volo.Saas.Host.Dtos;
using Volo.Saas.Tenants;

namespace Volo.Saas.Host
{
    [Authorize(SaasHostPermissions.Tenants.Default)]
    public class TenantAppService : SaasHostAppServiceBase, ITenantAppService
    {
        public TenantAppService(.........
        )

        [Authorize(SaasHostPermissions.Tenants.Create)]
        public virtual async Task<SaasTenantDto> CreateAsync(SaasTenantCreateDto input)
        {
        }
    }
}

I'm just targeting to override CreateAsync in my solution

[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(ITenantAppService), typeof(TenantAppService), typeof(NMMTenantAppService))]
public class NMMTenantAppService : TenantAppService
{
    public NMMTenantAppService(
        IEditionRepository editionRepository, 
        ITenantRepository tenantRepository, 
        ITenantManager tenantManager, 
        IDataSeeder dataSeeder)
        : base(
              tenantRepository: tenantRepository, 
              editionRepository: editionRepository, 
              tenantManager: tenantManager, 
              dataSeeder: dataSeeder)
    {

    }

    public async override Task<SaasTenantDto> CreateAsync(SaasTenantCreateDto input)
    {
        var tenant = await TenantManager.CreateAsync(input.Name, input.EditionId);
        input.MapExtraPropertiesTo(tenant);
        await TenantRepository.InsertAsync(tenant);

        await CurrentUnitOfWork.SaveChangesAsync();

        return ObjectMapper.Map<Tenant, SaasTenantDto>(tenant);
    }
}

Beside that I'm also not happy with** SaasTenantCreateDto**. Tricky part is I don't want to extend DTO, I want to remove properties What is the recommended way to do this in framework ?

Do I need create a new ApplicationService in my project with new interface ? And replace service from module with a new one

App Service

[Authorize(SaasHostPermissions.Tenants.Default)]
public class NMMTenantAppService : SaasHostAppServiceBase, INMMTenantAppService
{
}

Method

[Authorize(SaasHostPermissions.Tenants.Create)]
public async Task<SaasTenantDto> CreateAsync(**NMMSaasTenantCreateDto** input)
{

}

Interface

public interface INMMTenantAppService : ICrudAppService<SaasTenantDto, Guid, GetTenantsInput, **NMMSaasTenantCreateDto**, SaasTenantUpdateDto>
{

}

Dto

public class NMMSaasTenantCreateDto : SaasTenantCreateOrUpdateDtoBase
{
}
سؤال
  • ABP Framework version: v4.2.1
  • UI type: MVC
  • DB provider: EF Core / MongoDB
  • Tiered (MVC) or Identity Server Separated (Angular): yes

I'm getting an error from the jquery.timeago client library which is the popups with application template. Any idea ?

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.2.2
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • 2021-03-15 13:19:27.882 +03:00 [ERR] Invalid object name 'AbpBlobContainers'. Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid object name 'AbpBlobContainers'. at Microsoft.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__169_0(Task1 result) at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func4 operation, Func4 verifySucceeded, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable1.AsyncEnumerator.MoveNextAsync() at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync[TSource](IAsyncEnumerable1 asyncEnumerable, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync[TSource](IAsyncEnumerable1 asyncEnumerable, CancellationToken cancellationToken) at Volo.Abp.BlobStoring.Database.EntityFrameworkCore.EfCoreDatabaseBlobContainerRepository.FindAsync(String name, CancellationToken cancellationToken) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Volo.Abp.BlobStoring.Database.DatabaseBlobProvider.GetOrCreateContainerAsync(String name, CancellationToken cancellationToken) at Volo.Abp.BlobStoring.Database.DatabaseBlobProvider.SaveAsync(BlobProviderSaveArgs args) at Volo.Abp.BlobStoring.BlobContainer.SaveAsync(String name, Stream stream, Boolean overrideExisting, CancellationToken cancellationToken) at Volo.Abp.BlobStoring.BlobContainerExtensions.SaveAsync(IBlobContainer container, String name, Byte[] bytes, Boolean overrideExisting, CancellationToken cancellationToken) at Siemens.Odms.FileAppService.SaveBlobAsync(SaveBlobInput saveBlobInput) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.ProceedAsync() at Volo.Abp.Auditing.AuditingInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.ProceedAsync() at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed) at Siemens.Odms.FileController.SaveBlobAsync(SaveBlobInput saveBlobInput) at lambda_method3887(Closure , Object ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.
  • Steps to reproduce the issue:

Configure blobstoring model creation with table prefix

builder.ConfigureBlobStoring(optionsAction: options => { options.TablePrefix = "Any prefix apart from Abp"; options.Schema = dbSchema; });

Maybe i'm blind as bat but not able to locate Volo.Abp.BlobStoring.Database.EntityFrameworkCore ? or anything related with Volo.Abp.BlobStoring.Database blob provider ?

https://docs.abp.io/en/abp/latest/Features#other-feature-properties

  • ABP Framework version: v4.2.2
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes

IsVisibleToClients (default: true): Set false to hide the value of this feature from clients (browsers). Isn't that should remove option from UI Is this bug or Am i doing something wrong ?

سؤال

https://docs.abp.io/en/abp/latest/Testing#example-testing-an-application-service

  • ABP Framework version: v4.2.2

  • UI type: MVC

  • DB provider: EF Core

  • Tiered (MVC) or Identity Server Separated (Angular): yes

  • Exception message and stack trace:

  • Autofac.Core.DependencyResolutionException: 'An exception was thrown while activating Siemens.NMM.Saas.Host.NMMTenantAppService.'

  • -InnerException {"None of the constructors found with 'Volo.Abp.Autofac.AbpAutofacConstructorFinder' on type 'Siemens.NMM.Saas.Host.NMMTenantAppService' can be invoked with the available services and parameters:\r\nCannot resolve parameter 'Microsoft.AspNetCore.Hosting.IWebHostEnvironment hosting' of constructor 'Void .ctor(Volo.Saas.Editions.IEditionRepository, Volo.Saas.Tenants.ITenantRepository, Volo.Saas.Tenants.ITenantManager, Volo.Abp.Data.IDataSeeder, Microsoft.Extensions.Configuration.IConfiguration, Microsoft.AspNetCore.Hosting.IWebHostEnvironment)'."} System.Exception {Autofac.Core.DependencyResolutionException}

  • Steps to reproduce the issue: I just override TenantAppService which is coming from Saas Module. Changes are very simple, one overriding of existing method, one totally new method

Now i would like to add tests related with those 2 method therefore i created Service Tests which inherits from Application Test Base

GetRequiredService<INMMTenantAppService>(); not able to resolve service.

What am i missing ?

Check the docs before asking a question: https://docs.abp.io/en/abp/4.2/Entity-Framework-Core#repository-get-find-methods

  • ABP Framework version: v4.2.2
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes

IBasicRepository **Get ** and Find doesn't load related entities when even we set include details to the true

Aggregate Root

Entity

Repo Interface

Repo Implementation

EF Relations

Find Method Result

WithDetailsAsync

I would like create "custom" db migrator console app for my customers. Migrator should handle both commercial and non-commercial modules tables.

Error indicates that:

2021-05-12 16:56:31.322 +03:00 [INF] Started database migrations... 2021-05-12 16:56:31.337 +03:00 [INF] Migrating schema for host database... 2021-05-12 16:57:03.844 +03:00 [ERR] ABP-LIC-0020 - License code not found! Ensure that your appsettings.json has "AbpLicenseCode" key with your license code. 2021-05-12 16:57:03.844 +03:00 [ERR] ABP-LIC-0008 - License check failed for 'Volo.Abp.Identity.Pro.Domain-v4.3.0.0'.

.cs proj

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <EnvironmentName>Production</EnvironmentName>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Stage|AnyCPU'">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <EnvironmentName>Staging</EnvironmentName>
  </PropertyGroup>

Set both ASPNETCORE_ENVIRONMENT and ENVIRONMENT to the Production / anything that different from 'Development'

I tried use launch via dotnet with "-e"

What am i missing ?

Check the vstest platform architecture: https://github.com/microsoft/vstest-docs/blob/main/RFCs/0001-Test-Platform-Architecture.md Check the vstest data collectors: https://github.com/microsoft/vstest-docs/blob/main/RFCs/0006-DataCollection-Protocol.md Check the .runtimesettings : https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?branch=release-16.4&view=vs-2019

  • ABP Framework version: v4.4.4
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace: Error occurred during initialization of TestHost : System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.IO.Stream.ReadByte() at System.IO.BinaryReader.ReadByte() at System.IO.BinaryReader.Read7BitEncodedInt() at System.IO.BinaryReader.ReadString() at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.SocketCommunicationManager.ReceiveRawMessage() at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.SocketCommunicationManager.ReceiveMessage() at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.DataCollection.DataCollectionTestCaseEventHandler.ProcessRequests() at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.DataCollection.DataCollectionRequestHandler.<HandleBeforeTestRunStart>b__24_0()
  • Steps to reproduce the issue:"
  1. create new project by using abp suite module template
  2. add commercial package to the domain layer (e.g. filemanagement)
  3. create a new unit test (no extra step taken after code generation)
  4. try to debug/run test

my unit tests are not running when i use commercial volo packages in my module project i believe that is due to their license check

to collect for information regarding error i tried attached data collector to my testhost

datacollector log indicates :

TpTrace Information: 0 : 29556, 1, 2021/11/29, 10:18:52.689, 5623983708510, datacollector.exe, Listening on Endpoint : 127.0.0.1:58503
TpTrace Information: 0 : 29556, 1, 2021/11/29, 10:18:52.709, 5623983903030, datacollector.exe, DataCollectionRequestHandler.ProcessRequests : DataCollection started.
TpTrace Information: 0 : 29556, 1, 2021/11/29, 10:18:52.752, 5623984339050, datacollector.exe, DataCollectionRequestHandler.ProcessRequests : Datacollector received message: (DataCollection.TestHostLaunched) -> {
  "ProcessId": 22052
}
TpTrace Information: 0 : 29556, 1, 2021/11/29, 10:18:52.778, 5623984599936, datacollector.exe, ProcessDumpUtility.CrashDump: Creating mini dump of process testhost.x86 (22052) into temporary path 'C:\Users\xxxxxxx\AppData\Local\Temp\c0e3fc35-5300-4319-a040-548012a5c65a'.
TpTrace Information: 0 : 29556, 1, 2021/11/29, 10:18:52.780, 5623984616998, datacollector.exe, CrashDumperFactory: Creating dumper for Microsoft Windows 10.0.19042  with target framework .NETCoreApp,Version=v5.0.
TpTrace Information: 0 : 29556, 1, 2021/11/29, 10:18:52.780, 5623984618606, datacollector.exe, CrashDumperFactory: This is Windows on .NETCoreApp,Version=v5.0, returning the .NETClient dumper which uses env variables to collect crashdumps of testhost and any child process.
TpTrace Information: 0 : 29556, 4, 2021/11/29, 10:18:53.106, 5623987877765, datacollector.exe, Using the buffer size of 16384 bytes
TpTrace Information: 0 : 29556, 4, 2021/11/29, 10:18:53.106, 5623987878866, datacollector.exe, Accepted Client request and set the flag
TpTrace Information: 0 : 29556, 7, 2021/11/29, 10:19:06.855, 5624125359620, datacollector.exe, DataCollectionTestCaseEventHandler: Test case starting.
TpTrace Information: 0 : 29556, 7, 2021/11/29, 10:19:06.900, 5624125815083, datacollector.exe, Blame Collector : Test Case Start
TpTrace Information: 0 : 29556, 7, 2021/11/29, 10:19:06.902, 5624125830635, datacollector.exe, DataCollectionTestCaseEventHandler: Test case 'Siemens.Odms.Samples.SampleAppService_Tests.GetAsync - 59f413e1-9026-3a67-eb02-b7f70f6b998a' started.
TpTrace Error: 0 : 29556, 7, 2021/11/29, 10:19:08.834, 5624145153965, datacollector.exe, DataCollectionRequestHandler.HandleBeforeTestRunStart : Error occurred during initialization of TestHost : System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.IO.Stream.ReadByte()
   at System.IO.BinaryReader.ReadByte()
   at System.IO.BinaryReader.Read7BitEncodedInt()
   at System.IO.BinaryReader.ReadString()
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.SocketCommunicationManager.ReceiveRawMessage()
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.SocketCommunicationManager.ReceiveMessage()
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.DataCollection.DataCollectionTestCaseEventHandler.ProcessRequests()
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.DataCollection.DataCollectionRequestHandler.<HandleBeforeTestRunStart>b__24_0()
TpTrace Information: 0 : 29556, 1, 2021/11/29, 10:19:08.868, 5624145489916, datacollector.exe, DataCollectionRequestHandler.ProcessRequests : Datacollector received message: (DataCollection.AfterTestRunEnd) -> false

My current abp license allows me to access the commercial module source code. So i just disabled license checker at app init stage

Now i can run my unit test after this modification

Can you share an example project that shows how unit tests should be if we use a commercial package within the module? br

  • ABP Framework version: v5.1.1
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Steps to reproduce:
  • Create new module project by using module template with ui
  • Perform db updates
  • Launch IdentityServer, ApiHost and WebHost
  • Use menu item of "Settings"

maybe there missing module definition at during code generation.

عرض 1 الي 10 من 20 إدخالات
Made with ❤️ on ABP v8.2.0-preview Updated on مارس 25, 2024, 15:11