Monday, May 21, 2018

Angular 4 - How to detect device in browser

Its very simple and straight forward to use plugin for Angular 4 typescript as below

Use plugin which can be added to package.json to install as reference

Include in your app.module as below

import { DeviceDetectorModule } from 'ngx-device-detector';

imports: [

Include in your component or service as below

import { DeviceDetectorService } from 'ngx-device-detector';

constructor(private deviceService: DeviceDetectorService) {   }

To get device info use as below in component

this.deviceService.getDeviceInfo();  //This will get all device useragent info 
this.deviceService.isTablet(); //This will get device is tablet or not
this.deviceService.isDesktop(); //This will get device is desktop or not
this.deviceService.isMobile(); //This will get device is mobile or not

Wednesday, May 2, 2018

VS - Asp.Net core application not worked and run only on fiddler

I have faced some specific issue, where .Net core project was not running on my local machine visual studio and ruins only when Telerik Fiddler ruins. It always goes to 500 error page (only for me). I have tried changing all browser proxy settings, but those not fixed my

I was searching for my Outlook automatic replies not opened and calendar schedules not shown issue, for that got fix from Microsoft as, surprisingly it fixed my visual studio .net core project issue. Try below steps to reset proxy

Friday, February 16, 2018

Outlook 2016 integration to Skype for business Lync 2016

I got issue on outlook 2016 where Skype for business (Lync 2016) status for contacts not showing.

I have followed below steps and worked

1. Open RegEdit by typing in run command (WinKey + R)
3. Update DefaultIMApp value as "Lync" as in screenshot below
4. Restart outlook


Thursday, December 14, 2017

C# - How to merge paths with slashes in all subsequent params

To combine file paths with slashes will take care by below code

public static string MergePath(params string[] stringPaths)

            for (int i = 0; i < stringPaths.Length; i++)
                //To skip trim on first path
                if (i != 0)
                    stringPaths[i] = stringPaths[i].Trim().TrimStart(Path.DirectorySeparatorChar).TrimEnd(Path.DirectorySeparatorChar);

            return Path.Combine(stringPaths);


var stringtest = Extensions.MergePath(@"c:\path\", @"\dir\file.txt");
var stringtest2 = Extensions.MergePath(@"c:\path\",@"\test\adsf\", @"\dir\file.txt");
var stringtest3 = Extensions.MergePath(@"c:\path", @"test\adsf", @"dir\file.txt");


Monday, July 10, 2017

IIS - Application warmup

How to warm up IIS application especially when using Entity framework

Follow below steps to enable your website always respond quickly,

- Check "Application Initialization" feature enabled in windows features turn or off

- Start Mode of Application pool set as "Always Running" in AppPool Advanced Settings
- Preload of Website should be set as "true" in Website advanced settings
- Add Application Initialization script in web.config of your application as below, You can specify valid URL which can initialize all items such as SQL DB, EF etc.,

  <applicationInitialization doAppInitAfterRestart="true" skipManagedModules="false">
      <add initializationPage="/YourUrl/YourMethodAnything" />

Following these steps will solve your idle timeout application responding slow issue.