When running the command abp add-module Volo.Payment to install the Payment module, the installation encounters the following errors:
\Project\src\Project.Domain.Shared\ProjectDomainSharedModule.cs(24,20): error CS0234: Der Typ- oder Namespacename "Paypal" ist im Namespace "Volo.Payment" nicht vorhanden. (Möglicherweise fehlt ein Assemblyverweis.)
\Project\src\Project.Domain.Shared\ProjectDomainSharedModule.cs(50,23): error CS0246: Der Typ- oder Namespacename "AbpPaymentPayPalDomainSharedModule" wurde nicht gefunden (möglicherweise fehlt eine using-Direktive oder ein Assemblyverweis).
The cause of this is a type in the ProjectDomainSharedModule. It includes it with "using Volo.Payment.Paypal;" instead of "using Volo.Payment.PayPal;"
Resolving the typo fixed the issue
As the title suggests, when you a modular Application with an initial module and install it, you get type errors. The integration model that the generator uses seems to be itself broken. I've fixed it temporarily by adding a manual symlink in the symlink-config.ps1 file but I don't know how stable that will be.
The MCP Server for my ABP Studio 3.0.4 installation is not starting up. I've already tried reinstalling and deleting the .abp/studio folder, as well as reverting to 3.0.3 but the issue persists. I tried it on a colleague's PC and the issue was the same.
Steps to reproduce the issue:
Hello Support-Team,
we've recently renewed our license on a new organization (Jeremias). However, my user is still in the old one (Jeremias Group), which causes some conflicts. For example, I still get the reminder that I should renew my license. When using ABP Studio, I also default to Jeremias Group there.
Can you please remove me from the old Jeremias Group org?
Best regards Dario
Autofac.Core.Registration.ComponentNotRegisteredException: The requested service 'Volo.Abp.AspNetCore.Components.Web.AbpBlazorMessageLocalizerHelper`1...
Autofac.Core.Registration.ComponentNotRegisteredException
The requested service 'Volo.Abp.AspNetCore.Components.Web.AbpBlazorMessageLocalizerHelper`1[[DummyPlatform.Localization.DummyPlatformResource, DummyPlatform.Domain.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency.
See https://autofac.rtfd.io/help/service-not-registered for more info.
at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType, IEnumerable`1 parameters)
at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType)
at Autofac.Extensions.DependencyInjection.AutofacServiceProvider.GetRequiredService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at Volo.Abp.AbpTestBaseWithServiceProvider.GetRequiredService[T]()
at DummyPlatform.Blazor.Tests.Items.ItemPage_IntegrationShould.Load_Items() in C:\Users\user\source\repos\DummyPlatform\test\DummyPlatform.Blazor.Tests\Items\ItemPage_IntegrationShould.cs:line 22
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
Item.razor
@page "/items"
@using DummyPlatform.Items
@using DummyPlatform.Localization
@using Volo.Abp.AspNetCore.Components.Web
@inherits DummyPlatformComponentBase
@inject IItemAppService ItemAppService
@inject AbpBlazorMessageLocalizerHelper<DummyPlatformResource> LH
<Card>
<CardHeader>
<Row Class="justify-content-between">
<Column ColumnSize="ColumnSize.IsAuto">
<h2>@L["Items"]</h2>
</Column>
</Row>
</CardHeader>
<CardBody>
<DataGrid TItem="ItemDto"
Data="ItemList"
ReadData="OnDataGridReadAsync"
TotalItems="TotalCount"
ShowPager="true"
PageSize="PageSize">
<DataGridColumns>
<DataGridColumn TItem="ItemDto"
Field="@nameof(ItemDto.ItemNr)"
Caption="@L["ItemNr"]"></DataGridColumn>
<DataGridColumn TItem="ItemDto"
Field="@nameof(ItemDto.VariantCode)"
Caption="@L["VariantCode"]"></DataGridColumn>
<DataGridColumn TItem="ItemDto"
Field="@nameof(ItemDto.Description)"
Caption="@L["Description"]"></DataGridColumn>
</DataGridColumns>
</DataGrid>
</CardBody>
</Card>
<Modal @ref="ItemDetailModal">
<_ModalBackdrop></_ModalBackdrop>
<ModalContent IsCentered="true">
<Form>
<ModalHeader>
<ModalTitle>@OpenedItem.ItemNr</ModalTitle>
<CloseButton Clicked="CloseItemDetailModal"></CloseButton>
</ModalHeader>
<ModalBody>
<Field>
<FieldLabel>@L["ItemNr"]</FieldLabel>
<TextEdit @bind-Text="@OpenedItem.ItemNr"></TextEdit>
</Field>
<Field>
<FieldLabel>@L["VariantCode"]</FieldLabel>
<TextEdit @bind-Text="@OpenedItem.ItemNr"></TextEdit>
</Field>
<Field>
<FieldLabel>@L["Description"]</FieldLabel>
<TextEdit @bind-Text="@OpenedItem.Description"></TextEdit>
</Field>
</ModalBody>
<ModalFooter>
<Button Color="Color.Secondary"
Clicked="CloseItemDetailModal">
@L["Cancel"]
</Button>
</ModalFooter>
</Form>
</ModalContent>
</Modal>
Unit Test
using DummyPlatform.Items;
using DummyPlatform.Localization;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Localization;
using NSubstitute;
using Volo.Abp.AspNetCore.Components.Web;
using Xunit;
namespace DummyPlatform.Blazor.Tests.Items;
public class ItemPage_IntegrationShould : DummyPlatformBlazorTestBase
{
private IItemAppService _itemAppService;
private AbpBlazorMessageLocalizerHelper<DummyPlatformResource> _lh;
[Fact]
public void Load_Items()
{
// Arrange
var ctx = CreateTestContext();
_itemAppService = Substitute.For<IItemAppService>();
_lh = GetRequiredService<AbpBlazorMessageLocalizerHelper<DummyPlatformResource>>();
ctx.Services.AddSingleton(_itemAppService);
ctx.Services.AddSingleton(_lh);
// Act
ctx.RenderComponent<DummyPlatform.Blazor.Pages.Items>();
// Assert
_itemAppService.Received(1).GetListAsync(Arg.Any<GetItemListDto>());
}
}
I kept the Testbase the same as in the blogpost. As you can see, I kept very close to the Tutorial from the ABP documentation, so someone else could encounter the same problem. Do I maybe have a missing dependency here?
When I call GuidGenerator.Create() in my DomainService, that I instantiated in a test, I get a NullReferenceException. I think I could solve this by implementing the IDomainService instead and then mock the IGuidGenerator interface. However, there really is no need to do that here aside from testing concerns.
Do you have any suggestions on how to workaround this issue?
(ItemManager.cs)
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Domain.Services;
namespace TestPlatform.Items;
public class ItemManager : DomainService
{
private readonly IItemRepository _itemRepository;
public ItemManager(IItemRepository itemRepository)
{
_itemRepository = itemRepository;
}
public async Task<Item> CreateAsync(
string itemNr,
int variantCode,
string description,
)
{
var existingItem = await _itemRepository.FindByItemNrAndVariantAsync(itemNr, variantCode);
if (existingItem != null)
{
throw new ItemAlreadyExistsException(itemNr, variantCode);
}
var newGuid = GuidGenerator.Create();
return new Item(
newGuid,
itemNr,
variantCode,
description,
);
}
}
(ItemManagerTest.cs)
using System.Threading.Tasks;
using TestPlatform.Items.Shared;
using NSubstitute;
using NSubstitute.ReturnsExtensions;
using Shouldly;
using Xunit;
namespace TestPlatform.Items;
public class ItemManager_CreateAsyncShould
{
private IItemRepository itemRepository = Substitute.For<IItemRepository>();
[Fact]
public async Task Return_Item_If_No_Item_With_Same_ItemNr_Exists()
{
itemRepository.FindByItemNrAndVariantAsync(
ValidItemData.ItemNr,
ValidItemData.VariantCode
).ReturnsNull();
var itemManager = new ItemManager(itemRepository);
var item = await itemManager.CreateAsync(
ValidItemData.ItemNr,
ValidItemData.VariantCode,
ValidItemData.Description,
);
item.ShouldBeOfType<Item>();
item.ShouldNotBeNull();
}
}
Edit: For some reason, markdown removes everything inside the <> arrows. However, the content is not important for the problem at hand anyway.