Starts in:
0 DAY
2 HRS
31 MIN
34 SEC
Starts in:
0 D
2 H
31 M
34 S
Open Closed

The microservices template won't build #1878


User avatar
1
NickCoetzee created
  • ABP Framework version: 4.4.2
  • UI type: N/A
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): N/A
  • Exception message and stack trace:
  • Steps to reproduce the issue: Build the project

Hi,

The microservices template won't build

We're using the latest version 4.4.2

Build error:

Failed to restore C:\Work\MicroService\gateways\web\src\TestMicro.WebGateway\TestMicro.WebGateway.csproj (in 1.05 sec). Failed to restore C:\Work\MicroService\gateways\web-public\src\TestMicro.PublicWebGateway\TestMicro.PublicWebGateway.csproj (in 2.27 sec). Failed to restore C:\Work\MicroService\apps\web\src\TestMicro.Web\TestMicro.Web.csproj (in 5.16 sec). Failed to restore C:\Work\MicroService\shared\TestMicro.DbMigrator\TestMicro.DbMigrator.csproj (in 1.68 sec). Failed to restore C:\Work\MicroService\apps\public-web\src\TestMicro.PublicWeb\TestMicro.PublicWeb.csproj (in 7.2 sec). Failed to restore C:\Work\MicroService\shared\TestMicro.Shared.Hosting.Microservices\TestMicro.Shared.Hosting.Microservices.csproj (in 5.78 sec). Failed to restore C:\Work\MicroService\services\product\src\TestMicro.ProductService.HttpApi.Host\TestMicro.ProductService.HttpApi.Host.csproj (in 1.34 sec). Failed to restore C:\Work\MicroService\gateways\internal\src\TestMicro.InternalGateway\TestMicro.InternalGateway.csproj (in 1.87 sec). Failed to restore C:\Work\MicroService\services\identity\src\TestMicro.IdentityService.HttpApi.Host\TestMicro.IdentityService.HttpApi.Host.csproj (in 3.16 sec). Failed to restore C:\Work\MicroService\services\saas\src\TestMicro.SaasService.HttpApi.Host\TestMicro.SaasService.HttpApi.Host.csproj (in 1.74 sec). Failed to restore C:\Work\MicroService\apps\auth-server\src\TestMicro.AuthServer\TestMicro.AuthServer.csproj (in 10.54 sec).

Error number example:

Error NU1105 Unable to find project information for 'C:\Work\MicroService\services\identity\src\TestMicro.IdentityService.HttpApi\TestMicro.IdentityService.HttpApi.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. TestMicro.WebGateway C:\Work\MicroService\gateways\web\src\TestMicro.WebGateway\TestMicro.WebGateway.csproj 1


13 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. TestMicro.WebGateway

    Hi, try run the dotnet build command in the solution file folder

  • User Avatar
    0
    NickCoetzee created

    If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. TestMicro.WebGateway

    Hi, try run the dotnet build command in the solution file folder

    Hi, we now get this problem

    Starting IIS Express ... Successfully registered URL "https://localhost:44322/" for site "test.AuthServer" application "/" Registration completed for site "test.AuthServer" IIS Express is running. [11:18:14 INF] Starting test.AuthServer. [11:18:22 FTL] test.AuthServer terminated unexpectedly! Volo.Abp.AbpInitializationException: An error occurred during ConfigureServices phase of the module test.AdministrationService.EntityFrameworkCore.AdministrationServiceEntityFrameworkCoreModule, test.AdministrationService.EntityFrameworkCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. See the inner exception for details. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=5.0.10.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified. File name: 'Microsoft.EntityFrameworkCore, Version=5.0.10.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' at test.AdministrationService.EntityFrameworkCore.AdministrationServiceEntityFrameworkCoreModule.ConfigureServices(ServiceConfigurationContext context) at Volo.Abp.AbpApplicationBase.ConfigureServices() --- End of inner exception stack trace --- at Volo.Abp.AbpApplicationBase.ConfigureServices() at Volo.Abp.AbpApplicationBase..ctor(Type startupModuleType, IServiceCollection services, Action1 optionsAction) at Volo.Abp.AbpApplicationWithExternalServiceProvider..ctor(Type startupModuleType, IServiceCollection services, Action1 optionsAction) at Volo.Abp.AbpApplicationFactory.Create(Type startupModuleType, IServiceCollection services, Action1 optionsAction) at Volo.Abp.AbpApplicationFactory.Create[TStartupModule](IServiceCollection services, Action1 optionsAction) at Microsoft.Extensions.DependencyInjection.ServiceCollectionApplicationExtensions.AddApplication[TStartupModule](IServiceCollection services, Action`1 optionsAction) at test.AuthServer.Startup.ConfigureServices(IServiceCollection services) in D:\Documents\DesignIT\newMicro\test\apps\auth-server\src\test.AuthServer\Startup.cs:line 11 at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services) at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass9_0.

    We've installed .Net Core runtimes 5.0.10.0 but it appears as if a refererence in a project dependency does not have the right package installed. Also, many of the projects listed as dependencies are not visiblie within the solution tree. This could be what is causing the original error

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you try to remove IncludeAssets and PrivateAssets?

  • User Avatar
    0
    coop1 created

    hi

    Can you try to remove IncludeAssets and PrivateAssets?

    Hi there, I'm working on the same project with NickCoatzee, this solution seems to have worked but we are now running into an error with the test_Administration database:

    SqlException: Cannot open database "test_Administration" requested by the login. The login failed. Login failed for user 'sa'. Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, bool breakConnection, Action<Action> wrapCloseInAction) Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, bool callerHasConnectionLock, bool asyncClose) Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, out bool dataReady) Microsoft.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) Microsoft.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(bool enlistOK) Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, string newPassword, SecureString newSecurePassword, bool ignoreSniOpenTimeout, TimeoutTimer timeout, bool withFailover) Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, string newPassword, SecureString newSecurePassword, bool redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, string newPassword, SecureString newSecurePassword, bool redirectedUserInstance) Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, object providerInfo, string newPassword, SecureString newSecurePassword, bool redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, bool applyTransientFaultHandling, string accessToken, DbConnectionPool pool) Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) Microsoft.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, uint waitForMultipleObjectsTimeout, bool allowCreate, bool onlyOneCheckConnection, DbConnectionOptions userOptions, out DbConnectionInternal connection) Microsoft.Data.ProviderBase.DbConnectionPool.WaitForPendingOpen() Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(bool errorsExpected, CancellationToken cancellationToken) Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(bool errorsExpected, CancellationToken cancellationToken) Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenAsync(CancellationToken cancellationToken, bool errorsExpected) Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable<T>+AsyncEnumerator.InitializeReaderAsync(DbContext _, bool result, CancellationToken cancellationToken) Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync<TState, TResult>(TState state, Func<DbContext, TState, CancellationToken, Task<TResult>> operation, Func<DbContext, TState, CancellationToken, Task<ExecutionResult<TResult>>> verifySucceeded, CancellationToken cancellationToken) Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable<T>+AsyncEnumerator.MoveNextAsync() Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync<TSource>(IQueryable<TSource> source, CancellationToken cancellationToken) Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync<TSource>(IQueryable<TSource> source, CancellationToken cancellationToken) Volo.Abp.LanguageManagement.EntityFrameworkCore.EfCoreLanguageRepository.GetListByIsEnabledAsync(bool isEnabled, CancellationToken cancellationToken) Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous<TResult>(IInvocation invocation, IInvocationProceedInfo proceedInfo) Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue<TResult>.ProceedAsync() Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter<TInterceptor>.InterceptAsync<TResult>(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func<IInvocation, IInvocationProceedInfo, Task<TResult>> proceed) Volo.Abp.LanguageManagement.DatabaseLanguageProvider.KkJsFLNKt() Volo.Abp.Caching.DistributedCache<TCacheItem, TCacheKey>.GetOrAddAsync(TCacheKey key, Func<Task<TCacheItem>> factory, Func<DistributedCacheEntryOptions> optionsFactory, Nullable<bool> hideErrors, bool considerUow, CancellationToken token) Volo.Abp.LanguageManagement.DatabaseLanguageProvider.GetLanguagesAsync() Microsoft.AspNetCore.RequestLocalization.DefaultAbpRequestLocalizationOptionsProvider.GetLocalizationOptionsAsync() Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass6_1+<<UseMiddlewareInterface>b__1>d.MoveNext() Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

    Thanks

  • User Avatar
    0
    NickCoetzee created

    hi

    Can you try to remove IncludeAssets and PrivateAssets?

    Hi, we need this to work, these workarounds are wasting our time at the moment as we are just encountering more errors with every step suggested.

    It looks as if there are bugs in the Microservices solution that need to be addressed and a fix pushed for the solution itself.

    Please treat this as a matter of urgency as it's messing around with our deliverables.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    SqlException: Cannot open database "test_Administration" requested by the login. The login failed. Login failed for user 'sa'.

    Please check the username and password of the database. Have you migrated the database?

  • User Avatar
    0
    coop1 created

    hi

    SqlException: Cannot open database "test_Administration" requested by the login. The login failed. Login failed for user 'sa'.

    Please check the username and password of the database. Have you migrated the database?

    Hi there, this worked, all applications and services are running succesfully as per the tutorial and we are able to run the Web and PublicWeb applications. The final issue we are running into though is with the infrastructure services, specifically Prometheus:

    Is there any additional configuration in Docker/Prometheus/Solution we need to perform? Thanks

  • User Avatar
    0
    scottie.tang@cpy.com.hk created

    Hi support.

    I run into the same problem as NickCoetzee. I have tried removing IncludeAssets and PrivateAssets as advised, but no luck. Please help.

    Starting IIS Express ... Successfully registered URL "https://localhost:44322/" for site "Micro1.AuthServer" application "/" Registration completed for site "Micro1.AuthServer" IIS Express is running. [11:59:04 INF] Starting Micro1.AuthServer. [11:59:04 FTL] Micro1.AuthServer terminated unexpectedly! Volo.Abp.AbpInitializationException: An error occurred during ConfigureServices phase of the module Micro1.AdministrationService.EntityFrameworkCore.AdministrationServiceEntityFrameworkCoreModule, Micro1.AdministrationService.EntityFrameworkCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. See the inner exception for details. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=5.0.10.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified. File name: 'Microsoft.EntityFrameworkCore, Version=5.0.10.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' at Micro1.AdministrationService.EntityFrameworkCore.AdministrationServiceEntityFrameworkCoreModule.ConfigureServices(ServiceConfigurationContext context) at Volo.Abp.AbpApplicationBase.ConfigureServices() --- End of inner exception stack trace --- at Volo.Abp.AbpApplicationBase.ConfigureServices() at Volo.Abp.AbpApplicationBase..ctor(Type startupModuleType, IServiceCollection services, Action1 optionsAction) at Volo.Abp.AbpApplicationWithExternalServiceProvider..ctor(Type startupModuleType, IServiceCollection services, Action1 optionsAction) at Volo.Abp.AbpApplicationFactory.Create(Type startupModuleType, IServiceCollection services, Action1 optionsAction) at Volo.Abp.AbpApplicationFactory.Create[TStartupModule](IServiceCollection services, Action1 optionsAction) at Microsoft.Extensions.DependencyInjection.ServiceCollectionApplicationExtensions.AddApplication[TStartupModule](IServiceCollection services, Action`1 optionsAction) at Micro1.AuthServer.Startup.ConfigureServices(IServiceCollection services) in C:_Temp\Micro1\apps\auth-server\src\Micro1.AuthServer\Startup.cs:line 11 at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services) at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass9_0.

  • User Avatar
    1
    gterdem created
    Senior .NET Developer

    Microservice template is more complex than monolith solutions because of the nature of microservice development itself. Main solution doesn't consist all the projects but just the runnable projects. So that you need to manually build all the referenced projects by yourself if you are not using tye.

    AdministrationService.EntityFrameworkCore version mismatch is related with local nuget cache referance and we are investigating if there is a configuration error on our side or if there is a bug on Microsoft side.

    Currently, removing PrivateAssets and IncludeAssets to set default in AdministrationService.EntityFrameworkCore.csproj file seems to fix the version mismatch as shown above.

  • User Avatar
    0
    scottie.tang@cpy.com.hk created

    Thanks. Understood and resolved now.

  • User Avatar
    0
    coop1 created

    Microservice template is more complex than monolith solutions because of the nature of microservice development itself. Main solution doesn't consist all the projects but just the runnable projects. So that you need to manually build all the referenced projects by yourself if you are not using tye.

    AdministrationService.EntityFrameworkCore version mismatch is related with local nuget cache referance and we are investigating if there is a configuration error on our side or if there is a bug on Microsoft side.

    Currently, removing PrivateAssets and IncludeAssets to set default in AdministrationService.EntityFrameworkCore.csproj file seems to fix the version mismatch as shown above.

    Hi, thank you for the clarification, however after resolving the errors and getting all the applications running we are still running into the Prometheus error as shown above. All the other infrastructure services are working except for Prometheus. Any solution you could provide would be much appreciated. Thanks

  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    Hi, thank you for the clarification, however after resolving the errors and getting all the applications running we are still running into the Prometheus error as shown above. All the other infrastructure services are working except for Prometheus. Any solution you could provide would be much appreciated. Thanks

    You need to add prometheus data in Grafana UI as far as I remember. Sorry, I don't have much knowledge about Grafana and Prometheus.

    You can also remove them from your docker-compose.infrastructure.yml (also from .override) file if you are not using.

  • User Avatar
    0
    coop1 created

    Hi, thank you for the clarification, however after resolving the errors and getting all the applications running we are still running into the Prometheus error as shown above. All the other infrastructure services are working except for Prometheus. Any solution you could provide would be much appreciated. Thanks

    You need to add prometheus data in Grafana UI as far as I remember. Sorry, I don't have much knowledge about Grafana and Prometheus.

    You can also remove them from your docker-compose.infrastructure.yml (also from .override) file if you are not using.

    Hi there, we want to use Prometheus and Grafana in our project. I've added Prometheus as a datasource in Grafana, and when I create a dashboard using Prometheus as a datasource I can see metrics I can add to the dashboard: However there really isn't any data to show as the Prometheus targets page still shows the same errors as above. Is there anything you can think of to resolve this, or would you recommend I contact Prometheus support? Thanks

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06