I am not sure whether to report this under 4.2 or 4.1. I just generated a new project using Suite. My ABP CLI and Suite are version 4.1.2. After creating a new tiered MVC project, I am getting a bunch of errors about missing Volo.CmsKit.Pro* packages.
Severity Code Description Project File Line Suppression State Error NU1101 Unable to find package Volo.CmsKit.Pro.HttpApi. No packages exist with this id in source(s): ABP Commercial NuGet Source, BlazoriseMyGet, Microsoft Visual Studio Offline Packages, nuget.org, OtisEd NuGet Source IronGlass.HttpApi C:\AppDev\IronGlass\IronGlass\aspnet-core\src\IronGlass.HttpApi\IronGlass.HttpApi.csproj 1
Here is an excerpt from the *.Domain csproj file. <ItemGroup> <PackageReference Include="Volo.Abp.Emailing" Version="4.2.0" /> <PackageReference Include="Volo.Abp.Identity.Domain" Version="4.2.0" /> <PackageReference Include="Volo.Abp.PermissionManagement.Domain.Identity" Version="4.2.0" /> <PackageReference Include="Volo.Abp.IdentityServer.Domain" Version="4.2.0" /> <PackageReference Include="Volo.Abp.PermissionManagement.Domain.IdentityServer" Version="4.2.0" /> <PackageReference Include="Volo.Abp.BackgroundJobs.Domain" Version="4.2.0" /> <PackageReference Include="Volo.Abp.AuditLogging.Domain" Version="4.2.0" /> <PackageReference Include="Volo.Abp.FeatureManagement.Domain" Version="4.2.0" /> <PackageReference Include="Volo.Abp.SettingManagement.Domain" Version="4.2.0" /> <PackageReference Include="Volo.Abp.BlobStoring.Database.Domain" Version="4.2.0" /> <PackageReference Include="Volo.Abp.LanguageManagement.Domain" Version="4.2.0" /> <PackageReference Include="Volo.Abp.LeptonTheme.Management.Domain" Version="4.2.0" /> <PackageReference Include="Volo.Saas.Domain" Version="4.2.0" /> <PackageReference Include="Volo.Abp.TextTemplateManagement.Domain" Version="4.2.0" /> <!-- <TEMPLATE-REMOVE IF-NOT='CMS-KIT'> --> <PackageReference Include="Volo.CmsKit.Pro.Domain" Version="4.2.0" /> <!-- </TEMPLATE-REMOVE> --> </ItemGroup>
Beyond the obvious issues. Why does Sutie v4.1 generate a project with 4.2 references?
In that case, the Account Linking option should not show up when the authentication method is openid. The user experience is broken! The end user sees an option which works (links their account on the backend), but breaks their ability to return to the front end and does not actually change their logged in account for the front end application.
A further note on this. While the account profile pages show the new user, if you manually change the URL in the browser to the client app, the logged in user changes back (or stays depending on your perspective) to the original user account.
The issue with the persisted keys does not occur when the API is the root application of a website. I backed up and decided to attempt combining the applications so that the API is at the root and the angular client is deployed as a subfolder within the API.
In the Startup.cs file of the HttpApi.Host project, I added the following code to the ConfigureServices method:
services.AddSpaStaticFiles(configuration =>
{
configuration.RootPath = "client";
});
In the Configure method, I added the following:
app.UseSpaStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(
Path.Combine(env.ContentRootPath, "client")),
RequestPath = "/client"
});
app.UseSpa(spa =>
{
spa.Options.SourcePath = "client";
});
I created a local environment in Angular with the URI settings needed for this configuration, ran ng build for the new environment with a base-href value of /client/ and then used xcopy to place resulting dist files in my API project.
With this configuration, I can access both the client and the API locally. However, while the login/logout process works and the GET methods from the API work for the client, as soon as I attempt to post something from the client, I get an error which is not sent by the server and the following entry in the log files.
[ERR] The required antiforgery header value "RequestVerificationToken" is not present.
Upgrading to version 4.0.2 and recreating the project fixed the issue
After being directed to this from https://support.abp.io/QA/Questions/626/Bugs--Issues-v4X#answer-756752d8-cea0-580d-5ede-39f9883c69d9
which directed me to a proposed temporary solution at https://support.abp.io/QA/Questions/626/Bugs--Issues-v4X#answer-756752d8-cea0-580d-5ede-39f9883c69d9
I added the resolution section to packages.json, deleted the yarn.lock file, ran yarn and deleted all local cookies and storage.
The behaviour of the application has not changed, but I get a different error message.
I am having issues getting the angular web client to work when creating a new solution with Suite 4.0.1.
Steps to reproduce.
This does not happen with projects created with Suite 3.3.1.
Adding the [Authorize] attribute on the home controller eliminates the need to manually navigate to the login page. Since the Swagger UI cannot be used without logging in, you might as well add Authorize.
Ok. That works, but it is not obvious. Why not implement the Security Definition and Security Requirements for Swagger in the default template?
Here is the list of packages from my Application project. Keep in mind, we are not using MongoDb.
<ItemGroup>
<PackageReference Include="Volo.Abp.Account.Pro.Shared.Application" Version="3.3.1" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application" Version="3.3.1" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application" Version="3.3.1" />
<PackageReference Include="Volo.Saas.Host.Application" Version="3.3.1" />
<PackageReference Include="Volo.Abp.AuditLogging.Application" Version="3.3.1" />
<PackageReference Include="Volo.Abp.Identity.Pro.Application" Version="3.3.1" />
<PackageReference Include="Volo.Abp.IdentityServer.Application" Version="3.3.1" />
<PackageReference Include="Volo.Abp.Account.Pro.Public.Application" Version="3.3.1" />
<PackageReference Include="Volo.Abp.Account.Pro.Admin.Application" Version="3.3.1" />
<PackageReference Include="Volo.Abp.LanguageManagement.Application" Version="3.3.1" />
<PackageReference Include="Volo.Abp.TextTemplateManagement.Application" Version="3.3.1" />
<PackageReference Include="Volo.Abp.LeptonTheme.Management.Application" Version="3.3.1" />
</ItemGroup>
I commented out all tests and then started adding tests 1 at a time. The process works for 2 tests (any two), but the process starts showing errors when adding a 3rd test (any item). With 3 tests, it works sometimes and fails others. Very inconsistent, but it fails more than it succeeds. Adding a 4th test caused it to fail every time.
An example test case is shown below
public class ClassificationSubcategoryAppServiceTests : SynergyzApplicationTestBase
{
private readonly IClassificationSubcategoryAppService _classificationSubcategoryAppService;
private readonly IRepository<ClassificationSubcategory, int> _classificationSubcategoryRepository;
public ClassificationSubcategoryAppServiceTests()
{
_classificationSubcategoryAppService = GetRequiredService<IClassificationSubcategoryAppService>();
_classificationSubcategoryRepository = GetRequiredService<IRepository<ClassificationSubcategory, int>>();
}
[Fact]
public async Task GetListAsync()
{
// Act
var result = await _classificationSubcategoryAppService.GetListAsync(new GetClassificationSubcategoriesInput());
// Assert
result.TotalCount.ShouldBe(2);
result.Items.Count.ShouldBe(2);
result.Items.Any(x => x.Id == 2069964284).ShouldBe(true);
result.Items.Any(x => x.Id == 268848218).ShouldBe(true);
}
[Fact]
public async Task GetAsync()
{
// Act
var result = await _classificationSubcategoryAppService.GetAsync(2069964284);
// Assert
result.ShouldNotBeNull();
result.Id.ShouldBe(2069964284);
}
[Fact]
public async Task CreateAsync()
{
// Arrange
var input = new ClassificationSubcategoryCreateDto
{
Name = "b8aa10058749413fae20f5b21834f142e59c87e73ce8405d84ba798226f9eaed1a01fc330d1a4d91be561a465f9a47416045dfe08b7244ecbab46087feebdee2b5736e43a58846d78e1562a9ea5184caa69534d8d5174b0cb9ec4aede460d6f02d7f18040bd14bf8b69c8d2a6c8a68d575b65716869c4a0aa7e3a1683595dbd",
Definition = "989",
CedsFlag = true
};
// Act
var serviceResult = await _classificationSubcategoryAppService.CreateAsync(input);
// Assert
var result = await _classificationSubcategoryRepository.FindAsync(c => c.Id == serviceResult.Id);
result.ShouldNotBe(null);
result.Name.ShouldBe("b8aa10058749413fae20f5b21834f142e59c87e73ce8405d84ba798226f9eaed1a01fc330d1a4d91be561a465f9a47416045dfe08b7244ecbab46087feebdee2b5736e43a58846d78e1562a9ea5184caa69534d8d5174b0cb9ec4aede460d6f02d7f18040bd14bf8b69c8d2a6c8a68d575b65716869c4a0aa7e3a1683595dbd");
result.Definition.ShouldBe("989");
result.CedsFlag.ShouldBe(true);
}
[Fact]
public async Task UpdateAsync()
{
// Arrange
var input = new ClassificationSubcategoryUpdateDto()
{
Name = "9eb166489eb44c869edebebd65472cabd7abbdb868f44c22b6e2f236b6297a49366cab5647944c9a93bb7c892580f81310d6952b0a0d4b99a085f3e528eda76974d6586f55724aa6ac7545b0629885be4c5aeac1d89d46d190ae3e5ebf40d5b5ce5316e81da3466c931807bac703a899c9021cc6e867497191522bd8e0355d1",
Definition = "58f",
CedsFlag = true
};
// Act
var serviceResult = await _classificationSubcategoryAppService.UpdateAsync(2069964284, input);
// Assert
var result = await _classificationSubcategoryRepository.FindAsync(c => c.Id == serviceResult.Id);
result.ShouldNotBe(null);
result.Name.ShouldBe("9eb166489eb44c869edebebd65472cabd7abbdb868f44c22b6e2f236b6297a49366cab5647944c9a93bb7c892580f81310d6952b0a0d4b99a085f3e528eda76974d6586f55724aa6ac7545b0629885be4c5aeac1d89d46d190ae3e5ebf40d5b5ce5316e81da3466c931807bac703a899c9021cc6e867497191522bd8e0355d1");
result.Definition.ShouldBe("58f");
result.CedsFlag.ShouldBe(true);
}
[Fact]
public async Task DeleteAsync()
{
// Act
await _classificationSubcategoryAppService.DeleteAsync(2069964284);
// Assert
var result = await _classificationSubcategoryRepository.FindAsync(c => c.Id == 2069964284);
result.ShouldBeNull();
}
}