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

Activities of "abdourahmani"

Answer

Problem solved by upgrading to AspZero v5.1.0 and adding

web.config

<?xml version="2.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <httpErrors>   
            <remove statusCode="404" subStatusCode="-1" />                
            <error statusCode="404" path="/index.html" responseMode="ExecuteURL" />                
        </httpErrors>
        <staticContent>
            <mimeMap fileExtension=".json" mimeType="application/json" /> 
        </staticContent>
    </system.webServer>
</configuration>

Best regards, Abdourahmani

Answer

@ ismcagdas,

I'm completely lost. 3 days I'm stuck on this issue. And the way you handle my requests is really frustating.

I've sent the mail for the remote meeting and still no reaction.

isn't there someone else who can help ?

Abdourahmani

Answer

Please, When is this meeting for ?

Answer

No, the problem is not solved. How can we setup this meeting ?

Answer

Hi !

Here is the IIS directory structure on server :

[attachment=2:2qszsg8w]IIS Directories.png[/attachment:2qszsg8w]

Inside RapproDab, copied from dist.

[attachment=1:2qszsg8w]RapproDab.png[/attachment:2qszsg8w]

Inside assets :

[attachment=0:2qszsg8w]Assets.png[/attachment:2qszsg8w]

Another point : If, as resqueted, I run

ng --prod --base-href "RapproDab"

I've got this error message

The specified command --prod is invalid. For available options, see `ng help`.

But

ng build --env=prod --base-href "RapproDab"

runs to completion.

Regards,

Abdourahmani

Answer

Hi !

Here is what I got after applying the updates

[attachment=1:3lft5bkq]pic04.png[/attachment:3lft5bkq]

Could it be IIS config issues ? This is my first web app !

[attachment=0:3lft5bkq]pic05.png[/attachment:3lft5bkq]

Abdourahmani

Answer

Hi !

I have a similar problem when deploying my angular + core 2 web app (v5.0.4) to IIS.

dotnet core 2 api app is ok. it starts automaticaly when I browse it.

my customer want all his web apps on the same web server each in its sub directory under wwwroot.

I followed what is recommanded in this thread with no luck.

Building the app :

ng build --env=prod --deploy-url=RapproDab/

updated base href to /Rapprodab then got these errors : [attachment=2:1jq6wi6a]pic01.png[/attachment:1jq6wi6a]

Then I replace all occurences of "RapproDab" in index.html file from "RapproDab/inline.bundle.js" to "./inline.bundle.js".

which lead me to this :

[attachment=1:1jq6wi6a]pic02.png[/attachment:1jq6wi6a]

in the chrome console,

[attachment=0:1jq6wi6a]pic03.png[/attachment:1jq6wi6a]

This time I'm locked. No idea of what to do to resolve these errors.

Please help.

Abdourahmani

I've got it working.

Thank you !

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

<cite>alirizaadiyahsi: </cite> Hi @abdourahmani,

Did you see /ProjectName.Host/App_Data/Logs.txt? Is there any error message?

Here is the only message I found witch can be seen as an error message.

WARN 2017-10-09 14:54:48,920 [4 ] Mvc.ExceptionHandling.AbpExceptionFilter - Login failed! Abp.UI.UserFriendlyException: Login failed! at Lbi.RapproDab.Web.Controllers.TokenAuthController.<GetLoginResultAsync>d__32.MoveNext() in D:\MyWorkingDir\Lbi.RapproDab v4.5.1\aspnet-core\src\Lbi.RapproDab.Web.Core\Controllers\TokenAuthController.cs:line 511 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at Lbi.RapproDab.Web.Controllers.TokenAuthController.

Showing 31 to 40 of 52 entries