Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "abdourahmani"

Hi ! Can some one give me some guidance to correct this issue ? The App runs fines in developpment and crashes when deployed.

I'm using ASP.NET CORE & Angular V.6.0.0.

From IIS I can start the backend and it runs ok.

But when I launch the app from the browser, here is the error I get this error :

main.6b917b420639c862ad7c.js:1 ERROR SyntaxError: Unexpected token < in JSON at position 0

    at JSON.parse (<anonymous>)

    at XMLHttpRequest.o.onreadystatechange [as __zone_symbol__ON_PROPERTYreadystatechange] (main.6b917b420639c862ad7c.js:1)

    at XMLHttpRequest.E (polyfills.c60318e761d83ed91d05.js:1)

    at t.invokeTask (polyfills.c60318e761d83ed91d05.js:1)

    at Object.onInvokeTask (main.6b917b420639c862ad7c.js:1)

    at t.invokeTask (polyfills.c60318e761d83ed91d05.js:1)

    at e.runTask (polyfills.c60318e761d83ed91d05.js:1)

    at e.invokeTask [as invoke] (polyfills.c60318e761d83ed91d05.js:1)

    at m (polyfills.c60318e761d83ed91d05.js:1)

    at XMLHttpRequest.b (polyfills.c60318e761d83ed91d05.js:1)

Appconfig.json :

{
"remoteServiceBaseUrl": "http://localhost:22770",
"appBaseUrl": "http://localhost:4230",
"localeMappings": [
  {
    "from": "pt-BR",
    "to": "pt"
  },
  {
    "from": "zh-CN",
    "to": "zh"
  },
	{
		"from": "he-IL",
		"to": "he"
	}
]
}

appconfig.production.json

  "remoteServiceBaseUrl": "http://localhost:22770",
  "appBaseUrl": "http://localhost:4230",
  "localeMappings": [
    {
      "from": "pt-BR",
      "to": "pt"
    },
    {
      "from": "zh-CN",
      "to": "zh"
    },
	{
		"from": "he-IL",
		"to": "he"
	}
  ]
}

Hi ! Can some one give me some guidance to correct this issue ? The App runs fines in developpment and crashes when deployed.

I'm using ASP.NET CORE & Angular V.6.0.0

` Unhandled Exception: System.ArgumentNullException: Value cannot be null.

Parameter name: value

at System.Boolean.Parse(String value)

at Lbi.Immob.Web.Startup.AuthConfigurer.Configure(IServiceCollection services, IConfiguration configuration)

at Lbi.Immob.Web.Startup.Startup.ConfigureServices(IServiceCollection services) in D:\MyWorkingDir\Immob\aspnet-core\src\Lbi.Immob.Web.Host\Startup\Startup.cs:line 101

--- End of stack trace from previous location where exception was thrown ---

at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)

at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()

at Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize()

at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()

at Lbi.Immob.Web.Startup.Program.Main(String[] args) in D:\MyWorkingDir\Immob\aspnet-core\src\Lbi.Immob.Web.Host\Startup\Program.cs:line 10`

Hi all,

I've got this error when I put a radtool generated datatable into a modal view.

[attachment=0:js0qs05f]PrimengDataableHelper.getSorting.png[/attachment:js0qs05f]

It only hapens in modal views.

Can somebody help ?

Best regards,

Abdourahmani

I build views using RadTool and every is ok. when I transform these view to be modal views, they run fine but the row "Actions" buttons on datatable are not playing it well. 1 - They don't open the dropdown menu until I remove "normalizePosition" as in below

<div class="btn-group dropdown" normalizePosition>

2 - But the dropdown menu hides behind the paginator

[attachment=1:7it25coa]menuClosed.png[/attachment:7it25coa] [attachment=0:7it25coa]menuOpen.png[/attachment:7it25coa]

Style overlay on the column doesn't help

[style]="{'overflow':'visible'}"

Can somebody help me please ?

Best regards,

Abdourahmani

Hi, I also hit this error, but upgrading abp-ng2-module to is 2.1.0 doesn't help.

After the logging, if the authentication is ok, the login screen is replaced by spinner with stay for a very long time.

then this screen is displayed :

[attachment=0:rka1pmbg]PageNeRepondantPas.png[/attachment:rka1pmbg]

and there's no way to through this.

Please help.

Abdourahmani

Hi,

My application (v.5.1.0 angular + aspnet.core) gets its data from reports produced by other applications. I parse these reports using XlsxJs or Papaparse into arrays of json records.

Then I send this data to the backend service using

this._AtmService.loadAtmTransInput(data, this.initDb).subscribe(
                // process Ok => next
                () => {
                    this.notifyProgressBar();
                    this.progress.incrementLoading();
                    resolve();
                },
                // process error => Error
                () => {
                    this.notifyProgressBar();
                    this.progress.incrementLoading();
                }
            );

"loadAtmTransInput" is imported this way

import { AtmTransServiceProxy, AtmTransDto } from 'shared/service-proxies/service-proxies';

.

Here is my backend service :

public class AtmTransAppService : RapproDabAppServiceBase, IAtmTransAppService
    {
        private readonly IImportDataManager<AtmTrans, long, AtmTransDto> _importManager;

        public AtmTransAppService(IImportDataManager<AtmTrans, long, AtmTransDto> importManager)
        {
            _importManager = importManager;
            _importManager.TableName = "AtmTrans";
            _importManager.KeyToUpdate = AppSettings.AppBusinessManagement.AtmTransactionsRead;
        }

        public void LoadAtmTransInput(List<AtmTransDto> input, bool init)
        {
            _importManager
                .LoadDataInput(input);
        }

        public void InitDbTable(bool init)
        {
            _importManager
                .InitDbTable(init);
        }
    }

Things went fine until I deployed to production.

Now I'm getting errors : [attachment=1:9elqo3c9]an error has occured.png[/attachment:9elqo3c9]

in the browse console : [attachment=0:9elqo3c9]No access control.png[/attachment:9elqo3c9]

I don't have errors in the log file. A daily upload consist of 40 files of 1 MB of size (5000 records) each. And files are processed one by one.

My questions are : 1 - Is this the right way to do it ? 2 - If I save the formated json records in files, How can I upload them (mainly, how to receive files in the backend) 3 - Saving to SQL Server takes too long, how can I improve this part of the process.

Any clue to overcome these problems is welcome.

Best regards,

Abdourahmani

It's said that

ng build --prod --base-href "./"

will build angular for production. But for me it fails with this error : [attachment=1:bid928af]error build prod.png[/attachment:bid928af]

Am I incorrectly adding this component ?

instead, this command

ng build --env=prod --base-href "./"

runs to completion. But it produce larges files : [attachment=0:bid928af]dist directory.png[/attachment:bid928af]

What am I doing wrong ?

(Angular 5 + Dot core 2, v5.1.0)

Best regards, Abdourahmani

Hi !

I followed this link to implement an extension on IRepository.[https://gist.github.com/hikalkan/74f624c0b42c78fb1619e92b3d1972f8])

But I get this error when instantiation the service class

ERROR 2018-02-14 10:54:38,335 [17   ] Mvc.ExceptionHandling.AbpExceptionFilter - Can't create component 'Lbi.RapproDab.AppService.Session.Close.CloseSessionAppService' as it has dependencies to be satisfied.

'Lbi.RapproDab.AppService.Session.Close.CloseSessionAppService' is waiting for the following dependencies:
- Service 'Abp.Domain.Repositories.IRepository`2[[Lbi.RapproDab.AppEntities.HisAcctTrans, Lbi.RapproDab.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Int64, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]' which was not registered.

Castle.MicroKernel.Handlers.HandlerException: Can't create component 'Lbi.RapproDab.AppService.Session.Close.CloseSessionAppService' as it has dependencies to be satisfied.

Here is my extension code

public static void Insert&lt;TEntity, 
            TPrimaryKey&gt;(this IRepository&lt;TEntity, TPrimaryKey&gt; repository, IEnumerable&lt;TEntity&gt; entities)
            where TEntity : class, IEntity&lt;TPrimaryKey&gt;, new()
        {
            var type = Type.GetType("Lbi.RapproDab.RepositoryHelpers, Lbi.RapproDab.EntityFrameworkCore");

            var bulkInsertMethod = type.GetMethod("BulkInsert", BindingFlags.Static | BindingFlags.Public);

            var genericMethod = bulkInsertMethod.MakeGenericMethod(typeof(TEntity), typeof(TPrimaryKey));

            genericMethod.Invoke(null, new object[] { repository, entities });
        }

If I really have to register IRepository, what will be the implementation name (YYYYYYYYY)?

IocManager.Register(typeof(IRepository&lt;,&gt;), typeof(YYYYYYYYY&lt;,&gt;), DependencyLifeStyle.Transient);

Hi ! I'm trying to build a generic DomainService. Here is my code :

Domain Service

public interface IImportDataManager<TEntity, TType, in TEntityDto> : IDomainService
    {
        string TableName { get; set; }

        IImportDataManager<TEntity, TType, TEntityDto> LoadDataInput(IEnumerable<TEntityDto> input);

        IImportDataManager<TEntity, TType, TEntityDto> InitDbTable(bool init);
    }

    public class ImportDataManager<TEntity, TType, TEntityDto> : DomainService, IImportDataManager<TEntity, TType, TEntityDto>
    where TEntity : class, IEntity<TType>
    where TEntityDto : class, IEntityDto<TType>
    {
        private readonly IMapper _iMapper;
        private readonly DbContext _db;
        public string TableName { get; set; } = "";

        public ImportDataManager(IRepository<TEntity, TType> repository, IMapper iMapper)
        {
            _iMapper = iMapper;
            _db = repository.GetDbContext();
        }

        public IImportDataManager<TEntity, TType, TEntityDto> LoadDataInput(IEnumerable<TEntityDto> input)
        {
            var list = input.Select(custAtmTrans => _iMapper.Map<TEntity>(custAtmTrans)).ToList();
            _db.AddRange(list);
            _db.SaveChanges();
            return this;
        }

        public IImportDataManager<TEntity, TType, TEntityDto> InitDbTable(bool init)
        {
            if (!init) return this;
            var sql = $"Delete from {TableName};";
            _db.Database.ExecuteSqlCommand(sql);
            return this;
        }
    }

Application Service (Consumer)

public class AcquereurAppService : RapproDabAppServiceBase, IAcquereurAppService
    {
        private readonly IImportDataManager<Acquereur, long, AcquereurDto> _importManager;

        public AcquereurAppService(IImportDataManager<Acquereur, long, AcquereurDto> importManager)
        {
            _importManager = importManager;
            _importManager.TableName = "Acquereur";
        }

        public void LoadAcquereurInput(IEnumerable<AcquereurDto> input, bool init)
        {
            _importManager
                .InitDbTable(init)
                .LoadDataInput(input);
        }
    }

Test Class

public class AcquereurAppServiceTests : AppTestBase
    {
        private readonly IAcquereurAppService _appService;
        private readonly List<AcquereurDto> _dataListOk;
        private readonly List<AcquereurDto> _dataListNotOk;
        private readonly DateTime _transDate;

        public AcquereurAppServiceTests()
        {
            _transDate = DateTime.Now.Date;
            _appService = Resolve<IAcquereurAppService>();
            var data = new TestDataClass();
            _dataListOk = data.GetGoodAcquereurTrans();
            _dataListNotOk = data.GetBadAcquereurTrans(); 
        }

        [Fact]
        public void Should_Create_Acquereur_With_Valid_Arguments()
        {
            //Act
            _appService.LoadAcquereurInput(_dataListOk, true);

            //Assert
            UsingDbContext(context =>
            {
                var number = context.Acquereurs.Count(p => p.TrnDt == _transDate);
                number.ShouldBe(10);
            });
        }

        [Fact]
        public void Should_Not_Create_Acquereur_With_Invalid_Arguments()
        {
            //Act and Assert
            Assert.Throws<AbpValidationException>(() =>
            {
                _appService.LoadAcquereurInput(_dataListNotOk, true);
            });
        }
    }

But I receive this error.

Castle.MicroKernel.Handlers.HandlerException : Can't create component 'Lbi.RapproDab.AppService.Import.AcquereurAppService' as it has dependencies to be satisfied.

'Lbi.RapproDab.AppService.Import.AcquereurAppService' is waiting for the following dependencies:
- Service 'Lbi.RapproDab.AppBusiness.Import.IImportDataManager`3[[Lbi.RapproDab.AppEntities.Acquereur, Lbi.RapproDab.Core, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null],[System.Int64, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Lbi.RapproDab.AppDto.AcquereurDto, Lbi.RapproDab.Application, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null]]' which was not registered.

What am I doing wrong ?

Please help.

Abdourahmani

Hi, I have a problem retrieving data.

<ins>Entity definition</ins>

public class AtmData : FullAuditedEntity<long>
    { 
       [Required]
        public virtual DateTime TransDate { get; set; }

        /// <summary>
        /// Montant de la transaction
        /// </summary>
        public virtual decimal TransAmount { get; set; }
}

<ins>DbContext :</ins>

public virtual DbSet<AtmData> AtmTrans { get; set; }

<ins>Application Service</ins>

private readonly IRepository<AtmData, long> _atmTransRepository;

        var atmTrans = _atmTransRepository.GetAll() ;

But GetAll() always returns nothing. I have the same problem with all tables defines with PK other then the default type int. All tables defined with default Pk int work fine.

Please help, I'm unable to see the problem for 2 days now.

Regards Abdourahmani

Showing 1 to 10 of 13 entries