Hi! I'm trying to run ABP services from a console application.
I was guided by this example [https://support.aspnetzero.com/QA/Questions/9031/Accessing--DomainService-Repositories-from-outside-Web-Solution] (https://support.aspnetzero.com/QA/Questions/9031/Accessing--DomainService-Repositories-from-outside-Web-Solution), specifically using the example https://github.com/aspnetboilerplate/aspnetboilerplate-samples/blob/master/AbpEfConsoleApp/AbpEfConsoleApp/Program.cs, but I can't get it to work.
When I run it I get the following error: (VCloud is the name of my app)
> Castle.MicroKernel.Handlers.HandlerException
HResult=0x80131500
Message=Can't create component 'VCloud.VCloudCustom.Common.VCloudSettingProvider' as it has dependencies to be satisfied.
'VCloud.VCloudCustom.Common.VCloudSettingProvider' is waiting for the following dependencies:
Service 'Abp.Domain.Repositories.IRepository`2[[Abp.Configuration.Setting, Abp.Zero.Common, Version=5.4.0.0, Culture=neutral, PublicKeyToken=null],
[System.Int64, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]' which was not registered.
Source=Castle.Windsor
StackTrace:
at Castle.MicroKernel.Handlers.DefaultHandler.AssertNotWaitingForDependency()
at Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context, Boolean requiresDecommission, Boolean instanceRequired, Burden& burden)
at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean instanceRequired)
at Castle.MicroKernel.Handlers.AbstractHandler.Resolve(CreationContext context)
at Castle.MicroKernel.DefaultKernel.ResolveComponent(IHandler handler, Type service, Arguments additionalArguments, IReleasePolicy policy, Boolean ignoreParentContext)
at Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, Arguments arguments, IReleasePolicy policy, Boolean ignoreParentContext)
at Castle.MicroKernel.DefaultKernel.Resolve(Type service, Arguments arguments)
at Castle.Windsor.WindsorContainer.Resolve(Type service)
at Abp.Dependency.IocManager.Resolve(Type type)
at Abp.Dependency.IocResolverExtensions.ResolveAsDisposable[T](IIocResolver iocResolver, Type type)
at Abp.Configuration.SettingDefinitionManager.Initialize()
at Abp.AbpKernelModule.PostInitialize()
at Abp.Modules.AbpModuleManager.<>c.b__15_2(AbpModuleInfo module)
at System.Collections.Generic.List1.ForEach(Action1 action)
at Abp.Modules.AbpModuleManager.StartModules()
at Abp.AbpBootstrapper.Initialize()
at ConsoleTesting.Program.Main(String[] args) in D:\Source\Vinson\VCloud\ConsoleTesting\Program.cs:line 27
This exception was originally thrown at this call stack:
ConsoleTesting.Program.Main(string[]) in Program.cs
This is my code of the console app what im trying to do:
> using System;
using System;
using Abp;
using Abp.Dependency;
using Abp.Castle.Logging.Log4Net;
using Castle.Facilities.Logging;
using VCloud;
using VCloud.Rtdm.CashAudit;
namespace ConsoleTesting
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Starting");
//Bootstrapping ABP system
//using (var bootstrapper = AbpBootstrapper.Create<MyConsoleAppModule>())
using (var bootstrapper = AbpBootstrapper.Create<VCloudApplicationModule>())
{
bootstrapper.IocManager
.IocContainer
.AddFacility<LoggingFacility>(f => f.UseAbpLog4Net().WithConfig("log4net.config"));
bootstrapper.Initialize();
//Getting a Tester object from DI and running it
using (var tester = bootstrapper.IocManager.ResolveAsDisposable<RtdmCashAuditService>())
{
var r = tester.Object.Test();
Console.WriteLine(r);
} //Disposes tester and all it's dependencies
Console.WriteLine("Press enter to exit...");
Console.ReadLine();
}
}
}
>
>
> }
For some reason that I can't understand, I can't get him to take the language change.
It's like I'm not reading the language's XML. I even stepped on the English file with the Spanish ones and didn't change any text.
Testing the configuration I see that when I try the source = "AbpZero" texts appear, but when I change the name of my project (VCloud) nothing appears. As if I wasn't finding the XML.
Hi! AspNetZero 8.4 .Net Core Angular.
I have correctly configured the multitenant and access correctly via tenant1.mydomain.com and tenant2.mydomain.com. But now I don't know how to access the host site (the site that manages the tenants)
regards!
Good Morning
ASPNETZERO 8.4 / ANGULAR 8.3 / DOT NET CORE 3.1 / EF CORE 3.1 / POSTGRESQL DATBASE
I am making a manager to use create reports using SQL queries written by me, instead of leaving them to the FE for efficiency reasons. I already have dapper working properly for repositories, but I can't run an anonymous resoults query because dapper is asking me for a class to return the results to. I would use something like this in my reportsManager in the CORE layer, but I don't have a sql library in that layer, that is in the framework layer.
public class ReportsManager: VCloudDomainServiceBase,IReportsManager
{
private readonly IDapperRepository _genericDapperRepository;
public ReportsManager(IDapperRepository<GenericGroupDescription3Dto> genericDapperRepository)
{
_genericDapperRepository = genericDapperRepository;
}
public Task<IEnumerable> GetSalesByGroupRtdmAsync()
{
DateTime dateI = new DateTime(2020, 05, 01).ToUniversalTime();
DateTime dateF = new DateTime(2020, 05, 30).ToUniversalTime();
int restaurantId = 13;
var sqlQuery = @"SELECT article_name Description, sum(quantity) Value1, sum(quantity * unit_price) Value2, sum(0) Value3
FROM rtdm_orderitem OI JOIN rtdm_order O ON OI.order_id = O.id
WHERE O.restaurant_id = {0} AND O.created_timestamp between {1} AND {2}
GROUP BY article_name
ORDER BY 2 desc
LIMIT 10";
var connectionString = ((JObject)(JObject.Parse(File.ReadAllText("appsettings.json")))["ConnectionStrings"]).Property("Default").Value.ToString();
using (var connection = new NpgsqlConnection(FiddleHelper.GetConnectionStringSqlServerW3Schools()))
{
return connection.Query(sqlQuery, new {restaurantId, dateI,dateF});
}
}
}
So I create this generic class where to receive the results of the querys, but it doesn't work because I can't create it because I have to create the DbSet.
public class GenericGroupDescription3Dto : Entity
{
public int Id { get; set; }
public string Description { get; set; }
public decimal Value1 { get; set; }
public decimal Value2 { get; set; }
public decimal Value3 { get; set; }
}
<br> Is there a way to create a class that can be used by dapper to receive the results of a sql query? Is the approximation right or is the whole approach wrong?
Thanks!!
<br> <br>
Hello! First of all I wanted to congratulate you on the product, I have been using ABP a year ago and it seemed so good that it is worth moving to the commercial version, AspNetZero. I acquired a license 25 days ago and created a project and downloaded it. At that time the project was in Asp.Net Core & Angular v7.2.3 and .Net Core 2.2. I saw that the new version, v8.0, came out with support for .Net Core 3.0. But when I want to download the project I only see that I can download version v8.0 but for .Net Core 2.2. I download it and see that indeed all projects point to .Net Core 2.2.
If I upgrade all projects to .Net Core 3.0, compile Ok and manual swagger tests work. But if there is the angular app it gives an error in the browser "InternalServerError". Log information is as follows:
Microsoft.IdentityModel.Tokens.SecurityTokenInvalidSignatureException: IDX10503: Signature validation failed. Keys tried: '[PII is hidden. For more details, see https://aka.ms/IdentityModel/PII.] '. Exceptions caught: '[PII is hidden. For more details, see https://aka.ms/IdentityModel/PII.] '. token: '[PII is hidden. For more details, see https://aka.ms/IdentityModel/PII.] '. at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateSignature (String token, TokenValidationParameters validationParameters) at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateToken (String token, TokenValidationParameters validationParameters, SecurityToken & validatedToken) at VCloud.Web.Authentication.JwtBearer.VCloudJwtSecurityTokenHandler.ValidateToken (String securityToken, TokenValidationParameters validationParameters, SecurityToken & validatedToken) in D: \ Source \ Unidata \ ASPNetZero \ ASPNetZ-core \ ASPNetZero \ ASPNetZ-core \ ASPNetZ-core3 VCloud.Web.Core \ Authentication \ JwtBearer \ VCloudJwtSecurityTokenHandler.cs: line 40 at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync () INFO 2019-11-14 16: 46: 01,353 [24] uthentication.JwtBearer.JwtBearerHandler - Bearer was not authenticated. Failure message: IDX10503: Signature validation failed. Keys tried: '[PII is hidden. For more details, see https://aka.ms/IdentityModel/PII.] '. Exceptions caught: '[PII is hidden. For more details, see https://aka.ms/IdentityModel/PII.] '. token: '[PII is hidden. For more details, see https://aka.ms/IdentityModel/PII.] '. INFO 2019-11-14 16: 46: 01,354 [24] Microsoft.AspNetCore.Hosting.Diagnostics - Request finished in 3956.4738ms 404 DEBUG 2019-11-14 16: 46: 06,786 [19] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null DEBUG 2019-11-14 16: 46: 12,285 [4] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null DEBUG 2019-11-14 16: 46: 17,775 [4] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null DEBUG 2019-11-14 16: 46: 23,258 [4] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
Questions: 1-When downloading the project already created, it should not come already configured in .Net Core 3.? 2-Any idea why I have the error indicated?
One last point. I downloaded a demo project (v8.0.0, Aspnet core 3.0 + Angular) in a new database (the demo project IS configured for .net core 3.0 by default) and that project works perfectly for me.
I have been with this problem for several days and I can't find how to solve it This is my 3 post on the subject regards!!
What is the correct way to perform an update from 7.2.3 to 8? I bought the product only 20 days ago and there are already two versions.
From the download page I see that I can download the project in version v8.0.0 but with .Net Core 2.2.
I have no problem starting with a project from scratch because there is little customizations already does in these 20 days.
600/5000 I installed a newly created dot net core project on an IIS, but it didn't work. I execute the DDL by hand using "dotnet project.Web.Host.dll" and I got an error: An assembly specified in the application dependencies manifest (VCloud.Web.Host.deps.json) was not found: package: 'Abp.AspNetCore.SignalR', version: '4.9.0' path: 'lib / netstandard2.0 / Abp .AspNetCore.SignalR.dll '
Then I added it to the project, I deployed it again and there it worked. Question: Why was that missing dll not referenced in the original project?
hI ! I am a new client that has been using the opersource, ABP version for a year. I know the product.
I Download the project and install it, configure the connection string in a ms sql on a remote virtual server, login with a sql client and I see that the base was created well and I see the tables. The problem is when I run the * .Web.Host fron the visual studio. This opens a browser with the swagger but gives me the error:
An unhandled exception occurred while processing the request. InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource<DbConnectionInternal> retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, out DbConnectionInternal connection)
System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource<DbConnectionInternal> retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, out DbConnectionInternal connection) System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource<DbConnectionInternal> retry, DbConnectionOptions userOptions) System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource<DbConnectionInternal> retry, DbConnectionOptions userOptions) System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource<DbConnectionInternal> retry) System.Data.SqlClient.SqlConnection.Open() Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnection(bool errorsExpected) Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(bool errorsExpected) Microsoft.EntityFrameworkCore.Storage.RelationalConnection.BeginTransaction(IsolationLevel isolationLevel) Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions+<>c__DisplayClass18_0.<BeginTransaction>b__0(DatabaseFacade database) Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions+<>c__DisplayClass12_0<TState, TResult>.<Execute>b__0(DbContext c, TState s) Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute<TState, TResult>(TState state, Func<DbContext, TState, TResult> operation, Func<DbContext, TState, ExecutionResult<TResult>> verifySucceeded) Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute<TState, TResult>(IExecutionStrategy strategy, Func<TState, TResult> operation, Func<TState, ExecutionResult<TResult>> verifySucceeded, TState state) Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute<TState, TResult>(IExecutionStrategy strategy, TState state, Func<TState, TResult> operation) Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.BeginTransaction(DatabaseFacade databaseFacade, IsolationLevel isolationLevel) Abp.EntityFrameworkCore.Uow.DbContextEfCoreTransactionStrategy.CreateDbContext<TDbContext>(string connectionString, IDbContextResolver dbContextResolver) in DbContextEfCoreTransactionStrategy.cs Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.GetOrCreateDbContext<TDbContext>(Nullable<MultiTenancySides> multiTenancySide, string name) in EfCoreUnitOfWork.cs Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase<TDbContext, TEntity, TPrimaryKey>.<GetQueryable>b__7_0(Type key) in EfCoreRepositoryBaseOfTEntityAndTPrimaryKey.cs System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue>.GetOrAdd(TKey key, Func<TKey, TValue> valueFactory) Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase<TDbContext, TEntity, TPrimaryKey>.GetQueryable() in EfCoreRepositoryBaseOfTEntityAndTPrimaryKey.cs Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase<TDbContext, TEntity, TPrimaryKey>.GetAllIncluding(Expression<Func<TEntity, object>>[] propertySelectors) in EfCoreRepositoryBaseOfTEntityAndTPrimaryKey.cs Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase<TDbContext, TEntity, TPrimaryKey>.GetAllListAsync(Expression<Func<TEntity, bool>> predicate) in EfCoreRepositoryBaseOfTEntityAndTPrimaryKey.cs Abp.Threading.InternalAsyncHelper.AwaitTaskWithPostActionAndFinallyAndGetResult<T>(Task<T> actualReturnValue, Func<Task> postAction, Action<Exception> finalAction) Abp.Configuration.SettingStore.GetAllListAsync(Nullable<int> tenantId, Nullable<long> userId) in SettingStore.cs Abp.Threading.InternalAsyncHelper.AwaitTaskWithPostActionAndFinallyAndGetResult<T>(Task<T> actualReturnValue, Func<Task> postAction, Action<Exception> finalAction) Abp.Configuration.SettingManager.<GetApplicationSettingsAsync>b__38_0() in SettingManager.cs Abp.Runtime.Caching.CacheExtensions+<>c__DisplayClass9_0<TKey, TValue>+<<GetAsync>b__0>d.MoveNext() Abp.Runtime.Caching.CacheBase.GetAsync(string key, Func<string, Task<object>> factory) in CacheBase.cs Abp.Runtime.Caching.CacheExtensions.GetAsync<TKey, TValue>(ICache cache, TKey key, Func<TKey, Task<TValue>> factory) in CacheExtensions.cs Abp.Configuration.SettingManager.GetApplicationSettingsAsync() in SettingManager.cs Abp.Configuration.SettingManager.GetSettingValueForApplicationOrNullAsync(string name) in SettingManager.cs Abp.Configuration.SettingManager.GetSettingValueInternalAsync(string name, Nullable<int> tenantId, Nullable<long> userId, bool fallbackToDefault) in SettingManager.cs VCloud.Web.UiCustomization.UiThemeCustomizerFactory.GetCurrentUiCustomizer() in UiThemeCustomizerFactory.cs + var theme = await _settingManager.GetSettingValueAsync(AppSettings.UiManagement.Theme); VCloud.Sessions.SessionAppService.GetCurrentLoginInformations() in SessionAppService.cs + var uiCustomizer = await _uiThemeCustomizerFactory.GetCurrentUiCustomizer(); Abp.Threading.InternalAsyncHelper.AwaitTaskWithPostActionAndFinallyAndGetResult<T>(Task<T> actualReturnValue, Func<Task> postAction, Action<Exception> finalAction) VCloud.Web.Session.PerRequestSessionCache.GetCurrentLoginInformationsAsync() in PerRequestSessionCache.cs + cachedValue = await _sessionAppService.GetCurrentLoginInformations(); VCloud.Web.Controllers.UiController.Index() in UiController.cs + var model = new HomePageModel Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor+TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, object controller, object[] arguments) System.Threading.Tasks.ValueTask<TResult>.get_Result() Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync() Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync() Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync() Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync() Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ExceptionContext context) Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter() Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context) Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync() Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync() Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext) Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext) Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext) Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware+<>c__DisplayClass0_0+<<UseJwtTokenMiddleware>b__0>d.MoveNext() Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)