ABP Framework version: v4.0.0
UI type: MVC
DB provider: EF Core
Tiered (MVC) or Identity Server Separated (Angular): no
Exception message and stack trace:
Severity Code Description Project File Line Suppression State Error NU1101 Unable to find package Volo.Abp.AspNetCore.Tests. No packages exist with this id in source(s): ABP Commercial NuGet Source, BlazoriseMyGet, Microsoft Visual Studio Offline Packages, nuget.org Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests C:\LearnAbp\440\Acme.Bookstore\modules\Volo.BasicTheme\test\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests.csproj 1
- Steps to reproduce the issue:"
Created new 4.4.0 using app template and then tried to add the basic-theme scourcecode using the following command
C:\LearnAbp\440\Acme.Bookstore>abp add-module Volo.BasicTheme --with-source-code --add-to-solution-file
it seems it can't find Volo.Abp.AspNetCore.Tests nuget package
please help trying to create a preview video to demo new funtionality of 4.4.0
4 Answer(s)
-
0
The template which is being downloaded for the Basic-Theme has a lot of issues which need resolving after it has been added to the solution
The Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests.csproj file show contacing the following packages
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="4.4.0" /> <PackageReference Include="Volo.Abp.Autofac" Version="4.4.0" /> <PackageReference Include="Volo.Abp.AspNetCore.TestBase" Version="4.4.0" /> <PackageReference Include="NSubstitute" Version="4.2.2" /> <PackageReference Include="Shouldly" Version="4.0.3" /> <PackageReference Include="xunit" Version="2.4.1" /> <PackageReference Include="xunit.extensibility.execution" Version="2.4.1" /> <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" />
especially the following
<PackageReference Include="Volo.Abp.AspNetCore.Tests" Version="4.4.0" />
should be replaced with
<PackageReference Include="Volo.Abp.AspNetCore.TestBase" Version="4.4.0" />
the following lines also need to be added to
AbpAspNetCoreMvcUiBootstrapDemoTestBase.cs
file ofVolo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests.csproj
projectpublic abstract class AbpAspNetCoreMvcUiBootstrapDemoTestBase : AbpAspNetCoreTestBase<TestStartup>
to
public abstract class AbpAspNetCoreMvcUiBootstrapDemoTestBase : AbpAspNetCoreIntegratedTestBase<TestStartup>
the following lines also need to be added to
AbpAspNetCoreMvcUiBootstrapDemoTestBase.cs
file ofVolo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests.csproj
projectprotected virtual async Task<string> GetResponseAsStringAsync(string url, HttpStatusCode expectedStatusCode = HttpStatusCode.OK) { using (var response = await GetResponseAsync(url, expectedStatusCode)) { return await response.Content.ReadAsStringAsync(); } } protected virtual async Task<HttpResponseMessage> GetResponseAsync(string url, HttpStatusCode expectedStatusCode = HttpStatusCode.OK) { using (var requestMessage = new HttpRequestMessage(HttpMethod.Get, url)) { requestMessage.Headers.Add("Accept-Language", CultureInfo.CurrentUICulture.Name); var response = await Client.SendAsync(requestMessage); response.StatusCode.ShouldBe(expectedStatusCode); return response; } }
the file
AbpAspNetCoreMvcUiBootstrapDemoTestBase.cs
should be as followsusing System; using System.Globalization; using System.IO; using System.Linq; using System.Net; using System.Net.Http; using System.Threading.Tasks; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Hosting; using Shouldly; using Volo.Abp.AspNetCore.TestBase; namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo { public abstract class AbpAspNetCoreMvcUiBootstrapDemoTestBase : AbpAspNetCoreIntegratedTestBase<TestStartup> { protected override IHostBuilder CreateHostBuilder() { return base.CreateHostBuilder() .UseContentRoot(CalculateContentRootPath()); } private static string CalculateContentRootPath() { return CalculateContentRootPath( "Volo.Abp.sln", $"test{Path.DirectorySeparatorChar}Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo" ); } private static string CalculateContentRootPath( string testFileNameInTheRootFolder, string relativeContentPath) { var currentDirectory = Directory.GetCurrentDirectory(); while (!ContainsFile(currentDirectory, testFileNameInTheRootFolder)) { currentDirectory = new DirectoryInfo(currentDirectory).Parent.FullName; } if (!relativeContentPath.IsNullOrWhiteSpace()) { currentDirectory = Path.Combine(currentDirectory, relativeContentPath); } return currentDirectory; } private static bool ContainsFile(string currentDirectory, string projectFileName) { return Directory .GetFiles(currentDirectory, "*.*", SearchOption.TopDirectoryOnly) .Any(f => Path.GetFileName(f) == projectFileName); } protected virtual async Task<string> GetResponseAsStringAsync(string url, HttpStatusCode expectedStatusCode = HttpStatusCode.OK) { using (var response = await GetResponseAsync(url, expectedStatusCode)) { return await response.Content.ReadAsStringAsync(); } } protected virtual async Task<HttpResponseMessage> GetResponseAsync(string url, HttpStatusCode expectedStatusCode = HttpStatusCode.OK) { using (var requestMessage = new HttpRequestMessage(HttpMethod.Get, url)) { requestMessage.Headers.Add("Accept-Language", CultureInfo.CurrentUICulture.Name); var response = await Client.SendAsync(requestMessage); response.StatusCode.ShouldBe(expectedStatusCode); return response; } } } }
Please return my ticket
let me know when you have fixed basic-theme template so I can add it to my solution again and test
-
0
https://github.com/abpframework/abp/pull/9750
-
0
-
0
This question has been automatically marked as stale because it has not had recent activity.