Base solution for your next web application

Activities of "abarref"

Thanks. Indeed that seems like the easiest approach.

Tried the SmtpAppender and couldn't make it work. Enabled internal logging of log4net and found that the SmtpAppender is not available in .Net Core. The same issue as described here: smtpappender-missing-in-log4net-2-0-8-nuget

I'll go with custom Log4NetLogger approach another day with some more time.

Nice! I didn't know how to define the Custom Config Provider. I defined it like this in the CoreModule.PreInitialize method:

Configuration.CustomConfigProviders.Add(new AppCustomConfigProvider(IocManager.IocContainer.Resolve<CustomSettings>()));

Then it gets merged into the abp object in AppPreBootstrap.ts, so the last step was to define my custom settings in typings.d.ts:

declare namespace abp {
    namespace ui {
        function setBusy(elm?: any, text?: any, optionsOrPromise?: any): void;
    }
    namespace custom {
        namespace customSettings {
            interface ISomeCustomInterface {
                customProperty: boolean;
            }

            let someCustomSettings: ISomeCustomInterface;
        }
    }
}

Thanks for your guidance :)

Thanks for the clarification aaron.

Hi @jguldemod,

Thanks for offering your help :)

The other day I followed the suggestion made in a comment in the following thread: AspNetCoreModuleV2 and hostingModel="InProcess" in IIS sub application failing to start

The most common issue people have been running into is the CurrentDirectory() being set to C:\Windows\System32\inetsrv rather than the app directory. Our current recommendation is to use https://github.com/aspnet/Docs/blob/master/aspnetcore/host-and-deploy/aspnet-core-module/samples_snapshot/2.x/CurrentDirectoryHelpers.cs to work around this until a future patch release.

Is the same recomendation made by "neuhausf" in that other thread that aaron provided.

Your fix is the same or is something else?

Thanks @alper. That works. Is there a way to achieve the same but when the database gets initialized? Because I'm recreating the db a lot at the moment.

@alper thanks for the suggestion. I took a look at the source code and found that it is also possible to set it in the appsettings.json as follows:

Regards

Hi @timmackey, did you find a way to disable those messages?

Hi @maliming, thanks for your reply.

I found a workaround that implies transforming the nswag proxy response:

service.config.nswag file:

  "extensionCode": "service.extensions.ts",
  "clientBaseClass": "ClientBase",
  "useTransformOptionsMethod": true,
  "useTransformResultMethod": true,
  

service.extenisons.ts file:

...... UPDATED: please view the other answer below

It's not a clean solution but achieves the desired behaviour.

Sorry, I ommitted some lines that I thought were not required. This is my full service.extensions.ts:

import {map} from 'rxjs/operators';

export class ClientBase {
    protected transformOptions(options: any) {
        // Change options if required

        // console.log('HTTP call, options: ' + JSON.stringify(options));
        //
        // options.headers.append("myheader", "myvalue");

        // if (options != null) {
        //     options.isServiceProxyRequest = true;
        // }

        // options.responseType = 'json';

        // @ts-ignore
        return Promise.resolve(options);
    }

    protected transformResult<R, U>(url: string, response: R, processor: (response: R) => U) {
        let observable = processor(response);

        // @ts-ignore
        observable = observable.pipe(map((data) => {
            return this.isEmptyObject(data) ? null : data;
        }));

        return observable;
    }

    // Reference: https://stackoverflow.com/a/32108184/1454888
    isEmptyObject(obj) {
        if (obj == null) {
            return true;
        }

        if (obj.constructor === Array || obj.constructor === ArrayBuffer) {
            return false;
        }

        for (let prop in obj) {
            if (obj.hasOwnProperty(prop)) {
                return false;
            }
        }

        return JSON.stringify(obj) === JSON.stringify({});
    }
}

So to avoid those compilation issues I added // @ts-ignore on top of them

Showing 1 to 10 of 15 entries