Base solution for your next web application

Activities of "bilalhaidar"

I couldn't have solved it without your assistance.

Thanks a lot

Hello, Is there a place to explain more about the new license checking in the 5.x version? What are the rules that shouldn't be violated, etc.

For instance, one of the things I read is about developer count. If I have my code over 2 machines one at home and one at the office, does that count as 2 developers or 1?

Thank you Bilal

Thanks a lot.

Hi Jehad,

It seems the Castle Windsor is not catching the DevExpress Controllers.

In the Startup\XXXWebMvcModule.cs, add the following and it should work smooth:

public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(typeof(BarznWebWebMvcModule).GetAssembly());

            IocManager.Register(typeof(WebDocumentViewerController), DependencyLifeStyle.Transient);
            IocManager.Register(typeof(QueryBuilderController), DependencyLifeStyle.Transient);
            IocManager.Register(typeof(ReportDesignerController), DependencyLifeStyle.Transient);
        }

Hi Alper, Those controllers are part of DLLs offered by DevExpress.

Regards Bilal

Hi, I am running my application on a new laptop. I installed the database via update-database command and then tried to run the app. I get the following exception:

"Cannot insert explicit value for identity column in table 'XXX' when IDENTITY_INSERT is set to OFF."

The exception occurs on this line:

var parent = _context.SpecificNeeds.Add(new SpecificNeed("Child at risk")).Entity;
 _context.SaveChanges();

All was working fine on the previous machine.

Any idea what might be the problem?

Hello @alper,

This is the stack trace.

at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.Consume(RelationalDataReader reader)
   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(Tuple`2 parameters)
   at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.&lt;&gt;c__DisplayClass12_0`2.<Execute>b__0(DbContext c, TState s)
   at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute[TState,TResult](IExecutionStrategy strategy, Func`2 operation, Func`2 verifySucceeded, TState state)
   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(IEnumerable`1 commandBatches, IRelationalConnection connection)
   at Microsoft.EntityFrameworkCore.Storage.RelationalDatabase.SaveChanges(IReadOnlyList`1 entries)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(IReadOnlyList`1 entriesToSave)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(Boolean acceptAllChangesOnSuccess)
   at Microsoft.EntityFrameworkCore.DbContext.SaveChanges(Boolean acceptAllChangesOnSuccess)
   at Abp.EntityFrameworkCore.AbpDbContext.SaveChanges()
   at Tekvention.DrcApp.Migrations.Seed.DefaultSpecificNeedsCreator._create()
   at Tekvention.DrcApp.Migrations.Seed.DefaultSpecificNeedsCreator.Create()
   at Tekvention.DrcApp.Migrations.Seed.DefaultDrcBuilder.CreateDefaultDrcEntities()
   at Tekvention.DrcApp.Migrations.Seed.DefaultDrcBuilder.Create()
   at Tekvention.DrcApp.Migrations.Seed.SeedHelper.SeedHostDb(DrcAppDbContext context)
   at Tekvention.DrcApp.Migrations.Seed.SeedHelper.WithDbContext[TDbContext](IIocResolver iocResolver, Action`1 contextAction)
   at Tekvention.DrcApp.Migrations.Seed.SeedHelper.SeedHostDb(IIocResolver iocResolver)
   at Tekvention.DrcApp.Entity.DrcAppEntityFrameworkCoreModule.PostInitialize()
   at Abp.Modules.AbpModuleManager.<>c.<StartModules>b__15_2(AbpModuleInfo module)
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   at Abp.Modules.AbpModuleManager.StartModules()
   at Abp.AbpBootstrapper.Initialize()

Actually, I am not adding any value for the ID. This code was working before. Now on the new machine it is not.

I am just seeding some values and that's where I am getting the exception.

private void _create()
        {
            //Create if table is empty
            if (!_context.SpecificNeeds.Any())
            {
                var parent = _context.SpecificNeeds.Add(new SpecificNeed("Child at risk")).Entity;
                _context.SaveChanges(); // Exception here

Hi @ismcagdas

It is: SQL Server 2016

I run the script on the database you mean?

I noticed the following.

var item = new SpecificNeed("Child at risk");

The object item has Id equal to 0.

After running the line below:

var parent = _context.SpecificNeeds.Add(item).Entity;

Now parent object has Id with a value of -2147482647

Isn't that weird?

Showing 621 to 630 of 635 entries