Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.
it did kick me out at an hour, but it redirected me to the login which is wasnt doing before. how do we get to stay logged in for 8 or 10 hours?
ok, so we started with a new project and we added our code in until it broke. here is the line that broke our site. we confirmed it by commenting it out of our site and we are no longer experiancing the 15 minute limit. What i want to know is if there is anything in there we need or are we fine just getting rid of it?
//context.Services.ConfigureApplicationCookie(options =>
//{
// options.AccessDeniedPath = "/Identity/Account/AccessDenied";
// options.Cookie.Name = "TFORM";
// options.Cookie.HttpOnly = true;
// options.ExpireTimeSpan = TimeSpan.FromMinutes(1200);
// options.LoginPath = "/Account/Login";
// // ReturnUrlParameter requires
// //using Microsoft.AspNetCore.Authentication.Cookies;
// options.ReturnUrlParameter = CookieAuthenticationDefaults.ReturnUrlParameter;
// options.SlidingExpiration = true;
//});
is there a way to send the link privately? let me knwo if you need to the code or is my description is enough
yes we did. so let me catch you up on what we did. we migrated to 4.2. we implemented the async resolvers. we also discovered that in 4.2 the connection string for postgres changed, so we fixed that issue. so the next provlem we are having is it is throwing errors on some of your conneciton string names that do not seem to go through the resolver.
from our log file:
An exception occurred while iterating over the results of a query for context type 'Volo.Abp.LanguageManagement.EntityFrameworkCore.LanguageManagementDbContext'.
System.ArgumentException: Keyword not supported: rn4ocm5xnxtsv7e0prkzlqmuhgvtophtqi7w1+a4eavhxhmt3kb4iimrdn5iienlrggqmluzbqb2r+f5gv6hqwoy1szdhtn1hnisqckb0mskgwanbruw/m9nb5q8twubtxhdl0qqvbnxofmclur89onez9hacgivfz2lsghlr+rzjvgzpdx0yv1ltgwhb3f9q2a/vaxahp02+6xhjrnudzbvihxlp776hn2il7p0vzq (Parameter 'keyword')
at Npgsql.NpgsqlConnectionStringBuilder.GetProperty(String keyword)
at Npgsql.NpgsqlConnectionStringBuilder.Remove(String keyword)
at System.Data.Common.DbConnectionStringBuilder.set_ConnectionString(String value)
at Npgsql.NpgsqlConnectionStringBuilder..ctor(String connectionString)
at Npgsql.NpgsqlConnection.GetPoolAndSettings()
at Npgsql.NpgsqlConnection.set_ConnectionString(String value)
at Npgsql.NpgsqlConnection..ctor(String connectionString)
at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlRelationalConnection.CreateDbConnection()
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.get_DbConnection()
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.CreateDbCommand(RelationalCommandParameterObject parameterObject, Guid commandId, DbCommandMethod commandMethod)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject)
at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable1.Enumerator.InitializeReader(DbContext _, Boolean result) at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.Execute[TState,TResult](TState state, Func
3 operation, Func3 verifySucceeded) at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable
1.Enumerator.MoveNext()
the language management db context is somehow getting the encrypted connection string, not the decrypted version coming through the resolver. we also see this issue in the SaasDbContext as well. we are not implemnting a Saas connection string, it just grabs default, but how to we decrypt it in the pipeline of how you are getting it. i do have a project i can send you with code, the like is below:
no, we cant. in the web module, which only runs on startup public override void ConfigureServices(ServiceConfigurationContext context)
we create the filter and add it to the filter stack, as stated above: context.Services.AddMvc(options => options.Filters.Add(new TrackPerformanceFilter(connStr, configuration)));
so when the class is instastiated, it is start up, not at the time the controller is invoked, so we dont know the tenant, plus, it is only created once, there is no option to do DI in to the filter
Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.
context.Services.AddMvc(options => options.Filters.Add(new TrackPerformanceFilter(connStr, configuration)));
public void OnActionExecuting(ActionExecutingContext context)
{
var request = context.HttpContext.Request;
string paramsList = string.Empty;
foreach (var key in context.RouteData.Values?.Keys)
{
paramsList += $"{key}={(string)context.RouteData.Values[key]},";
}
if (string.IsNullOrEmpty(paramsList) == false)
{
paramsList = paramsList[0..^1];
}
PerformanceTrackingModel trackingInfo = new PerformanceTrackingModel
{
TenantId = Guid.NewGuid(),
StartedDateTime = DateTime.UtcNow,
ProcessName = request.Host.Host,
UrlPath = request.Path,
UrlMethod = request.Method,
UrlParameters = paramsList
};
_tracker.StartTracking(trackingInfo);
}
But i do not see how i can get the tenant in this function
no, that didnt solve it. i updated to 4.2.0, then i changed the resolved:
namespace DAG.TFORM.Web.Resolvers
{
[Dependency(ReplaceServices = true)]
public class TFORMMultiTenantConnectionStringResolver : MultiTenantConnectionStringResolver
{
public TFORMMultiTenantConnectionStringResolver(
IOptionsSnapshot<AbpDbConnectionOptions> options,
ICurrentTenant currentTenant,
IServiceProvider serviceProvider) : base(options, currentTenant, serviceProvider)
{
}
public override async Task<string> ResolveAsync(string connectionStringName = null)
{
string connectionString = string.Empty;
try
{
connectionString = await base.ResolveAsync(connectionStringName);
}
catch
{
return connectionString;
}
return string.IsNullOrEmpty(connectionString) ? connectionString : EncryptionHelper.Decrypt(connectionString);
}
}
}
But when i try to runit i still get this error:
An unhandled exception occurred while processing the request. ArgumentException: Format of the initialization string does not conform to specification starting at index 0. System.Data.Common.DbConnectionOptions.GetKeyValuePair(string connectionString, int currentPosition, StringBuilder buffer, bool useOdbcRules, out string keyname, out string keyvalue)
ArgumentException: Format of the initialization string does not conform to specification starting at index 0. System.Data.Common.DbConnectionOptions.GetKeyValuePair(string connectionString, int currentPosition, StringBuilder buffer, bool useOdbcRules, out string keyname, out string keyvalue) System.Data.Common.DbConnectionOptions.ParseInternal(Dictionary<string, string> parsetable, string connectionString, bool buildChain, Dictionary<string, string> synonyms, bool firstKey) System.Data.Common.DbConnectionOptions..ctor(string connectionString, Dictionary<string, string> synonyms, bool useOdbcRules) System.Data.Common.DbConnectionStringBuilder.set_ConnectionString(string value) Npgsql.NpgsqlConnectionStringBuilder..ctor(string connectionString) Npgsql.NpgsqlConnection.GetPoolAndSettings() Npgsql.NpgsqlConnection.set_ConnectionString(string value) Npgsql.NpgsqlConnection..ctor(string connectionString) Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlRelationalConnection.CreateDbConnection() Microsoft.EntityFrameworkCore.Storage.RelationalConnection.get_DbConnection() Microsoft.EntityFrameworkCore.Storage.RelationalCommand.CreateDbCommand(RelationalCommandParameterObject parameterObject, Guid commandId, DbCommandMethod commandMethod) Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable<T>+AsyncEnumerator.InitializeReaderAsync(DbContext _, bool result, CancellationToken cancellationToken) Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.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.GetListAsync(bool isEnabled) 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.MBFPd5o9y() 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)
we are having another resolver issue. when we tried to upgrade from 4.1.2 to 4.2.0 we started getting connection string issues. below is a screenshot of the error when we run. out connection string is encrypted. we have a resolver to decrypt it. it look to me as if there is somewhere we need to add a decryption somewhere that is not being covered by the resolver. thoughts?
our development cycle ends this coming week and i will have the time to put together the demo for that issue