I have copy System.Data.SqlClient.dll from MVC project (folder Bin/Release) and it is still crashing.
If you said it is should use version 4.8.1, why is it looking for version 4.6.1.0:
Could not load file or assembly 'System.Data.SqlClient, Version=4.6.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
The file that I've copied from MVC\Bin has a different version as well:
Hi,
No, it doesn't have. Should it be there?
Hi,
Even publishing using dotnet command with --self-contained parameter it doesn't work.
I have tried this command line, but not working as well:
dotnet publish -r win-x64 --self-contained true -p:PublishSingleFile=true --configuration Release
Hi,
I am using AspNetZero .Net Core JQuery framework and when I am publishing the Migrator project and running the Migrator.exe I am getting this exception below.
Does anyone an idea what is missing?
Thanks in advanced.
Exception:
2020-10-13 13:55:21 | Host database: Server=DbServer03; Database=iAPISDbProjectDBSERVER03; user id=iapis;password=T#FGEzZ8FSdv;
2020-10-13 13:55:21 | Continue to migration for this host database and all tenants..? (Y/N):
y
2020-10-13 13:55:22 | HOST database migration started...
2020-10-13 13:55:23 | An error occured during migration of host database:
2020-10-13 13:55:23 | Castle.MicroKernel.ComponentActivator.ComponentActivatorException: ComponentActivator: could not instantiate ASL.iAPIS.EntityFrameworkCore.iAPISDbContext
---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SqlClient, Version=4.6.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'System.Data.SqlClient, Version=4.6.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
at System.Reflection.RuntimePropertyInfo.get_Signature()
at System.Reflection.RuntimePropertyInfo.get_PropertyType()
at System.Reflection.MemberInfoExtensions.GetMemberType(MemberInfo memberInfo)
at Microsoft.EntityFrameworkCore.Metadata.Internal.MemberClassifier.FindCandidateNavigationPropertyType(MemberInfo memberInfo)
at Microsoft.EntityFrameworkCore.Metadata.Conventions.RelationshipDiscoveryConvention.GetNavigationCandidates(IConventionEntityType entityType)
at Microsoft.EntityFrameworkCore.Metadata.Conventions.RelationshipDiscoveryConvention.FindRelationshipCandidates(IConventionEntityTypeBuilder entityTypeBuilder)
at Microsoft.EntityFrameworkCore.Metadata.Conventions.RelationshipDiscoveryConvention.DiscoverRelationships(IConventionEntityTypeBuilder entityTypeBuilder, IConventionContext context)
at Microsoft.EntityFrameworkCore.Metadata.Conventions.RelationshipDiscoveryConvention.ProcessEntityTypeAdded(IConventionEntityTypeBuilder entityTypeBuilder, IConventionContext`1 context)
at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.ImmediateConventionScope.OnEntityTypeAdded(IConventionEntityTypeBuilder entityTypeBuilder)
at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.RunVisitor.VisitOnEntityTypeAdded(OnEntityTypeAddedNode node)
at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.OnEntityTypeAddedNode.Accept(ConventionVisitor visitor)
at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.ConventionVisitor.Visit(ConventionNode node)
at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.ConventionVisitor.VisitConventionScope(ConventionScope node)
at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.ConventionBatch.Run()
at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.ConventionBatch.Dispose()
at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.ImmediateConventionScope.OnModelInitialized(IConventionModelBuilder modelBuilder)
at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.OnModelInitialized(IConventionModelBuilder modelBuilder)
at Microsoft.EntityFrameworkCore.Metadata.Internal.Model..ctor(ConventionSet conventions)
at Microsoft.EntityFrameworkCore.ModelBuilder..ctor(ConventionSet conventions)
at Microsoft.EntityFrameworkCore.Infrastructure.ModelSource.CreateModel(DbContext context, IConventionSetBuilder conventionSetBuilder)
at Microsoft.EntityFrameworkCore.Infrastructure.ModelSource.GetModel(DbContext context, IConventionSetBuilder conventionSetBuilder)
at Microsoft.EntityFrameworkCore.Internal.DbContextServices.CreateModel()
at Microsoft.EntityFrameworkCore.Internal.DbContextServices.get_Model()
at Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkServicesBuilder.<>c.<TryAddCoreServices>b__7_3(IServiceProvider p)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at Microsoft.EntityFrameworkCore.DbContext.get_DbContextDependencies()
at Microsoft.EntityFrameworkCore.DbContext.get_InternalServiceProvider()
at Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<System.IServiceProvider>.get_Instance()
at Microsoft.EntityFrameworkCore.Infrastructure.Internal.InfrastructureExtensions.GetService[TService](IInfrastructure`1 accessor)
at Microsoft.EntityFrameworkCore.Infrastructure.AccessorExtensions.GetService[TService](IInfrastructure`1 accessor)
at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.get_Dependencies()
at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.Microsoft.EntityFrameworkCore.Internal.IDatabaseFacadeDependenciesAccessor.get_Dependencies()
at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.GetFacadeDependencies(DatabaseFacade databaseFacade)
at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.SetCommandTimeout(DatabaseFacade databaseFacade, Nullable`1 timeout)
at ASL.iAPIS.EntityFrameworkCore.iAPISDbContext..ctor(DbContextOptions`1 options) in D:\Source\iAPIS\Development\iAPIS_9.0.1\src\ASL.iAPIS.EntityFrameworkCore\EntityFrameworkCore\iAPISDbContext.cs:line 381
at lambda_method(Closure , Object[] )
at Castle.Core.Internal.ReflectionUtil.Instantiate(ConstructorInfo ctor, Object[] ctorArgs)
at Castle.Core.Internal.ReflectionUtil.Instantiate[TBase](Type subtypeofTBase, Object[] ctorArgs)
at Castle.Core.Internal.ReflectionUtil.CreateInstance[TBase](Type subtypeofTBase, Object[] ctorArgs)
at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstanceCore(ConstructorCandidate constructor, Object[] arguments, Type implType)
--- End of inner exception stack trace ---
at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstanceCore(ConstructorCandidate constructor, Object[] arguments, Type implType)
at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstance(CreationContext context, ConstructorCandidate constructor, Object[] arguments)
at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.Instantiate(CreationContext context)
at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext context)
at Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext context, Burden burden)
at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.CreateInstance(CreationContext context, Boolean trackedExternally)
at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext context, IReleasePolicy releasePolicy)
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[T](Arguments arguments)
at Abp.Dependency.IocManager.Resolve[T](Object argumentsAsAnonymousType)
at Abp.EntityFrameworkCore.DefaultDbContextResolver.Resolve[TDbContext](String connectionString, DbConnection existingConnection)
at Abp.Zero.EntityFrameworkCore.AbpZeroDbMigrator`1.CreateOrMigrate(AbpTenantBase tenant, Action`1 seedAction)
at Abp.Zero.EntityFrameworkCore.AbpZeroDbMigrator`1.CreateOrMigrateForHost(Action`1 seedAction)
at ASL.iAPIS.Migrator.MultiTenantMigrateExecuter.Run(Boolean skipConnVerification, Boolean isDockerEnabled) in D:\Source\iAPIS\Development\iAPIS_9.0.1\src\ASL.iAPIS.Migrator\MultiTenantMigrateExecuter.cs:line 64
2020-10-13 13:55:23 | Canceled migrations.
Press ENTER to exit...
I am using AspNetZero NET.Core JQuery version 9.0.1 and I have a website application in this solution.
I have created on the same solution an app for Droid and iOS using the projects already existing in the solution.
My question is if is it possible to create a new application for Droid using the same solution? Can I just duplicate the project .Droid creating a new folder, rename it, and then add it to the solution?
It will be a different application for different users. It will have a different layout, different context, different deploy/version. So, I don't think that using the same APK will be a good idea.
How can I do that?
Hi zony,
We have migrated this version and hosted it for tests around one week ago. That was the first time on this environment that it happened.
Have you seen it before or are there other topics related to this issue?
Hi.
I am using ASP.NET CORE MVC & jQuery .NET Core 3.1 v9.0.1 and I got an issue with Localization.
I have the application hosted on AWS running under IIS version 8.5. This morning, for a while, all menus and labels were in brackets instead of showing the written name as per in the Localization file.
In the log I could only see that the localization was not found, for example:
WARN 2020-09-07 20:57:00,122 [52 ] naries.DictionaryBasedLocalizationSource - Can not find 'Materials' in localization source 'iAPIS'! WARN 2020-09-07 20:57:00,127 [52 ] naries.DictionaryBasedLocalizationSource - Can not find 'VisitObservationQuestionTemplates' in localization source 'iAPIS'! WARN 2020-09-07 20:57:00,132 [52 ] naries.DictionaryBasedLocalizationSource - Can not find 'TaskGroups' in localization source 'iAPIS'! WARN 2020-09-07 20:57:00,137 [52 ] naries.DictionaryBasedLocalizationSource - Can not find 'TaskTypes' in localization source 'iAPIS'! WARN 2020-09-07 20:57:00,142 [52 ] naries.DictionaryBasedLocalizationSource - Can not find 'VisitTemplates' in localization source 'iAPIS'! WARN 2020-09-07 20:57:00,147 [52 ] naries.DictionaryBasedLocalizationSource - Can not find 'VisitStatus' in localization source 'iAPIS'! WARN 2020-09-07 20:57:00,156 [52 ] naries.DictionaryBasedLocalizationSource - Can not find 'WorkerCrews' in localization source 'iAPIS'! WARN 2020-09-07 20:57:00,161 [52 ] naries.DictionaryBasedLocalizationSource - Can not find 'WorkerVehicles' in localization source 'iAPIS'!
It has affected all users and tenants.
And then, after 10 minutes, doing absolutely nothing, it has restored by itself.
Any idea about what happened?
I have cleaned the tables below and it seems to be working:
AbpBackgroundJobs AbpNotifications AbpUserNotifications AbpTenantNotifications
I have tried to use a UnitOfWork transaction context and have changed the Sync method to Async, but, I am still getting the same exception.
Using UnitOfWorkManager to start a transaction.
Logger.Debug("Notification Rules - Processing Tenant: " + tenantProcessTime.Key.ToString() + " - startTime: " + startTime.ToString("HH:mm"));
using (var uow = UnitOfWorkManager.Begin())
{
using (CurrentUnitOfWork.SetTenantId(tenantId))
using (_session.Use(tenantId, null))
using (CurrentUnitOfWork.EnableFilter(AbpDataFilters.MustHaveTenant))
using (CurrentUnitOfWork.SetFilterParameter(AbpDataFilters.MustHaveTenant, AbpDataFilters.Parameters.TenantId, tenantId))
{
_notificationRulesManager.ProcessTenant(startTime, tenantId);
//CurrentUnitOfWork.SaveChanges();
uow.Complete();
}
}
Running the PulishAsync() instead of Publish():
AsyncHelper.RunSync(() => _notificationPublisher.PublishAsync(
AppNotificationNames.NotificationRules,
notificationData,
severity: NotificationSeverity.Info));
I am converting an application AspNetZero MVC/JQuery .Core 3.1 from version 5.5 to version 9.0.1 and I am getting some issues with Background Worker routines.
In my background worker, I have some methods to check data and sent user notifications using INotificationPublisher. When there is some notification to be sent, it is raising an exception after the whole methods are done and the methods DoWork is completed successfully. Note, all notifications are persisted in the database correctly, but, there is no signalR to the browser to update the UI.
I have removed all background works and left on this one running in case of being a concurrency issue, but it didn't work, I am still getting this exception.
In version 5.5 all Background Workers are working well!
Here is the exception:
ERROR 2020-08-26 11:57:23,019 [65 ] ASL.iAPIS.Debugging.ExceptionHandlerEx - ExceptionHandlerEx
Abp.BackgroundJobs.BackgroundJobException: A background job execution is failed. See inner exception for details. See BackgroundJob property to get information on the background job.
---> Abp.Domain.Uow.AbpDbConcurrencyException: Database operation expected to affect 1 row(s) but actually affected 0 row(s). Data may have been modified or deleted since entities were loaded. See http://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions.
---> Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException: Database operation expected to affect 1 row(s) but actually affected 0 row(s). Data may have been modified or deleted since entities were loaded. See http://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions.
at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ThrowAggregateUpdateConcurrencyException(Int32 commandIndex, Int32 expectedRowsAffected, Int32 rowsAffected)
at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ConsumeResultSetWithoutPropagation(Int32 commandIndex, RelationalDataReader reader)
at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.Consume(RelationalDataReader reader)
at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(IEnumerable1 commandBatches, IRelationalConnection connection) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(IList
1 entriesToSave)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(DbContext _, Boolean acceptAllChangesOnSuccess)
at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func3 operation, Func
3 verifySucceeded)
at Microsoft.EntityFrameworkCore.DbContext.SaveChanges(Boolean acceptAllChangesOnSuccess)
at Abp.EntityFrameworkCore.AbpDbContext.SaveChanges()
--- End of inner exception stack trace ---
at Abp.EntityFrameworkCore.AbpDbContext.SaveChanges()
at Abp.Zero.EntityFrameworkCore.AbpZeroCommonDbContext3.SaveChanges() at Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.SaveChangesInDbContext(DbContext dbContext) at Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.SaveChanges() at Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.CompleteUow() at Abp.Domain.Uow.UnitOfWorkBase.Complete() at Abp.Domain.Uow.UnitOfWorkInterceptor.InterceptSynchronous(IInvocation invocation) at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.Proxies.IRepository
2Proxy_1.Delete(BackgroundJobInfo entity)
at Abp.BackgroundJobs.BackgroundJobStore.Delete(BackgroundJobInfo jobInfo)
at Castle.Proxies.BackgroundJobStoreProxy.Delete_callback(BackgroundJobInfo jobInfo)
at Castle.Proxies.Invocations.IBackgroundJobStore_Delete.InvokeMethodOnTarget()
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Castle.Proxies.BackgroundJobStoreProxy.Delete(BackgroundJobInfo jobInfo)
at Abp.BackgroundJobs.BackgroundJobManager.TryProcessJob(BackgroundJobInfo jobInfo)
--- End of inner exception stack trace ---
Here is the method to notify users about expired visits:
private void ProcessScheduledVisitExpired(DateTime startTime, int tenantId, List<LocalizableMessageNotificationData> emailBody)
{
Logger.Debug("Notification Rules - ProcessScheduledVisitExpired - Start");
var active = SettingManager.GetSettingValueForTenant<bool>(AppSettings.iApisNotificationRules.NotCompletedVisitExpiredActive, tenantId);
if (!active)
{
Logger.Debug("Notification Rules - ProcessScheduledVisitExpired - Aborted - Rule is not Actived");
return;
}
var today = startTime.Date;
var visitExpiredDays = SettingManager.GetSettingValueForTenant<int>(AppSettings.iApisNotificationRules.NotCompletedVisitExpiredDays, tenantId);
var expiredDate = today.AddDays(-visitExpiredDays).Date;
Logger.Debug("Notification Rules - ProcessScheduledVisitExpired- Scheduled Not Completed Visit Expired Days: " + visitExpiredDays.ToString());
var expiredVisits = _visitReportRepository.GetAllIncluding(v => v.Apiary, v => v.Visit)
.Where(v => v.IsComplete == false && v.Visit.ScheduledDate.HasValue == true && v.Visit.ScheduledDate.Value.Date <= expiredDate)
.ToList();
Logger.Debug("Notification Rules - ProcessScheduledVisitExpired - expiredVisits lenght: " + expiredVisits.Count());
foreach (var visit in expiredVisits)
{
Logger.Debug("Notification Rules - ProcessScheduledVisitExpired- processing visit: " + visit.VisitId);
// Send the notification for users
var notificationData = new LocalizableMessageNotificationData(
new LocalizableString(
"ScheduledVisitExpired",
iAPISConsts.LocalizationSourceName
)
);
var days = visit.Visit.ScheduledDate.Value.Date.Subtract(today).Days + 1;
notificationData["notificationType"] = "Visit Scheduled Expired";
notificationData["visitId"] = visit.VisitId;
notificationData["apiaryName"] = visit.Apiary.ApiaryName;
notificationData["days"] = Math.Abs(days);
Logger.Debug("Notification Rules - ProcessScheduledVisitExpired - before Notification visit: " + visit.VisitId);
emailBody.Add(notificationData);
**// If this command is removed, the background Worker doesn't raise the exception.**
_notificationPublisher.Publish(
AppNotificationNames.NotificationRules,
notificationData,
severity: NotificationSeverity.Info);
Logger.Debug("Notification Rules - ProcessScheduledVisitExpired - after Notification visit: " + visit.VisitId);
}
Logger.Debug("Notification Rules - ProcessScheduledVisitExpired - End");
}