Skip to main content

Posts

Showing posts from 2018

Running a Asp.Net Core MVC app in IIS locally

.Net core MVC app by default run either in IIS Express or self hosted using Kestrel. The address is usually https://localhost:5001 or some random port. Now this is fine unless you want to test the app with some other services like social login with Twitter or Google. They dont like address with port numbers. As Asp.Net core apps runs out of process, you cannot just add a virtual directory in IIS to make your app work. The wiring up is little bit more convoluted. If you would like a deeper understanding, read this article. https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/aspnet-core-module?view=aspnetcore-2.1 Here are the steps to test your MVC app in IIS Enable IIS server roles. See steps here https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-2.1#iis-configuration Install ASP.Net Core module from here https://www.microsoft.com/net/permalink/dotnetcore-current-windows-runtime-bundle-installer Restart your IIS Create a new web

Closure and Captured variables

Here is a sample code. Can you guess what the output would be ? public static class TasksExample { public static void Execute() { Task[] tasks = new Task[10]; for (int i = 0; i < 10; i++) { tasks[i] = Task.Run(() => CalculateResult(i)); } Task.WaitAll(tasks); //ask.Wait(); //Console.WriteLine(tasks[i].Result); Console.WriteLine("Next work..."); } public static int CalculateResult(int i) { Console.WriteLine($"work starting {i}"); Thread.Sleep(10000); Console.WriteLine($"Completed work {i}"); return 100; } } Pat yourself if your answer was like this work starting 10 work starting 10 work starting 10 work starting 10 work starting 10 work starting 10 work starting 10 work starting 10 work starting 10 work starting 10 Completed

How to be more productive?

Are you one of the those who wants to do something you really like but feel that you are too busy and don’t have enough time. Do you feel that only if there were 48 hours in a day? Guess what you are not alone. These days always ON and connected world has helped us to peek into someone’s life on the other side of the world but has left no time for our own life. So how do you find the time? Step 1: Ask yourself: Are you productive or just active? Every task you do, think about the value it is generating. Are you just doing the task to keep yourself busy? Could you delegate the task? Does the task really need to be done? Bin any task that is not adding value and help you achieve your goals. Step 2: Do only the important but not urgent tasks Divide the tasks into four quadrants along  axis of important and urgent . Do the task while they are important but not urgent. Ignore the tasks that are not important and not urgent. Step 3: Learn to ignore Ignore any information that

How to get started with mobile app?

Are you new to mobile development and wondering where to get started in this saturated and complex world of frameworks? Are you wondering whether to go native, hybrid or new kid on the block: PWA ? I would suggest don't waste any time and just get your hands dirty.... When I started looking at mobile development, I went through the same experience. So to save you the time, I would suggest start with Ionic framework to start building Hybrid apps. You should be comfortable with HTML, JavaScript, some CSS and some Angular (SPA framework) knowledge would help but you can learn this as you go along. You can get started with Ionic in 3 simple steps . You can test you app locally in your browser or on your device using DevApp That's all you need to get started!!! Your career as mobile developer started in under 10 mins!! Happy development. Feel free to share any more similar frameworks in comments below.