takeUntil – IntervalObservable, Subject angular 11 not avaivable

https://stackoverflow.com/questions/42490265/rxjs-takeuntil-angular-components-ngondestroy

You could leverage a ReplaySubject for that:

EDIT: Different since RxJS 6.x: Note the use of the pipe() method.

class myComponent {
  private destroyed$: ReplaySubject<boolean> = new ReplaySubject(1);

  constructor(
    private serviceA: ServiceA,
    private serviceB: ServiceB,
    private serviceC: ServiceC) {}

  ngOnInit() {
    this.serviceA
      .pipe(takeUntil(this.destroyed$))
      .subscribe(...);
    this.serviceB
      .pipe(takeUntil(this.destroyed$))
      .subscribe(...);
    this.serviceC
      .pipe(takeUntil(this.destroyed$))
      .subscribe(...);
  }

  ngOnDestroy() {
    this.destroyed$.next(true);
    this.destroyed$.complete();
  }
}
let timer = IntervalObservable.create(60000);
this.subscription = timer.subscribe(

=======>
import {interval} from 'rxjs';
import {takeWhile} from 'rxjs/operators';
....
interval(60000).pipe(takeWhile(()=>this.alive).subscribe(

https://stackoverflow.com/questions/51688768/migration-from-rxjs-5-to-6-intervalobservable

log4net and configSource

https://stackoverflow.com/questions/445976/log4net-config-in-external-file-does-not-work

113

Do you have the following attribute in your AssemblyInfo.cs file:

[assembly: log4net.Config.XmlConfigurator(ConfigFile = "Log4Net.config", Watch = true)]

and code like this at the start of each class that requires logging functionality:

private static readonly ILog log = 
LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

I have a blog post containing this and other info here.

genaue try catch exception

C# Exception Handling Best Practices

durch mehrere catch- blocks können (zuerst) speziellere Exceptions behandelt werden , eine geauere auswahl kann durch when erzielt werden.

WebClient wc = null;
try
{
   wc = new WebClient(); //downloading a web page
   var resultData = wc.DownloadString("http://google.com");
}
catch (WebException ex) when (ex.Status == WebExceptionStatus.ProtocolError)
{
   //code specifically for a WebException ProtocolError
}
catch (WebException ex) when ((ex.Response as HttpWebResponse)?.StatusCode == HttpStatusCode.NotFound)
{
   //code specifically for a WebException NotFound
}
catch (WebException ex) when ((ex.Response as HttpWebResponse)?.StatusCode == HttpStatusCode.InternalServerError)
{
   //code specifically for a WebException InternalServerError
}
finally
{
   //call this if exception occurs or not
   wc?.Dispose();
}