Friday, 5 February 2016

IIS (Internet Information Services) Interview questions

IIS is an unavoidable part in case of a interview . As a web developer we all have the necessary knowledge about the Internet Information service. Here I am trying to list out the possible IIS interview questions . Please leave your valuable comment on this post.  

Q) What is IIS
        A) Internet information services  (IIS) are a web server which will runs the web site or web application which is hosted in the IIS . when we type on the browser address bar  actually a request is going to IIS and the IIS will manage the request and runs the .net code according to the request and give back the response.
The primary function of a web server is to store, process and deliver web pages to clients. The communication between client and server takes place using the Hypertext Transfer Protocol (HTTP).

Q) What are the different roles of IIS 
     A)IIS works as a web server. That is generate response to the client request Client may be a browser Like Mozilla Firefox . IIS maintains a detailed Log of the all request and response . IIS keeps a record about the location of content files , what security to access that files and how the files are separated into applications and what URL Mapped to these applications . IIS can be communicated with Microsoft share point , Microsoft visual studio.Net  and web distributed authoring and versioning to make web content creation fast and easy

Q)What is a worker process 
    A)Worker process runs the application in IIS. This is responsible for manage all the request and response that coming from client system.Worker process is the back bone of a system which runs on IIS (Internet Information services)

Q) What is worker process isolation mode 
    A) Application Isolation was introduced in IIS 4.0, In IIS 6.0 , You can isolate one application from another so that an error in one application doesnot affect another application runninng in a different process.This application isolation model provide better isolation but it compremise the performance .This application isolation ensures a leliable envirionment for an application server
Reference :

Q)What are application pools
      A)When running in worker process isolation mode you can seperate different web applications and web sites into groups known as application pools. An application pool is a group of one or more URLs that are served by a worker process or set of workerprocess . Any web directory or virtual directory can be assigned to application pool.
reference :

Q)What are the different versions of IIS ?
   A) IIS 5.1,IIS 6.0,IIS 7,IIS 8,IIS 8.5, IIS 10.

Q)What is binding in IIS website ?
 A) The binding helps you to configure the information required for requests to communicate with the website . You can configure your binding information when you create a website , Or you can edit the binding information after you create the site . Binding information includes the protocol that clients use to communicate with the site , the sites ip address , the port number and a host header.

Q)What are the components in IIS
  A) The main components of IIS are
   World wide web publishing service
   Windows Process Activation services

Q)Http.sys (Hypertext Transfer protocol stack)
  A)Hypertext Transfer protocol stack is the networking subsystem of windows operating systems, and it is implemented as a kernal-Mode device driver called HTTP protocol stack . HTTP.sys Listens for HTTP requests from the network, passes the request into IIS for processing and returns processed response to client browsers

Q)World wide web Publishing services
  A)In IIS 7 and above , functionality that was previously handled by the world wide web publishing service (WWWW service) alone is now split between twi service: WWW Service and a new service, Windows Process Activation Services (WAS). These two services run as LocalSystem in the same Avchost.exe process and share the same binaries

Q)Windows Process Activation services
   A)In IIS 7 and above , Window process activation Service (WAS) manages application and workker process insted of WWW Service. This enables you to use the same configuration and process model for HTTP and non-HTTP sites. Additionally, you can run WAS without the WWW Service if you do not need HTTP functionality. For example, you can manage a Web service through a WCF listener adapter, such as NetTcpActivator, without running the WWW Service if you do not need to listen for HTTP requests in HTTP.sys. For information about WCF listener adapters and about how to host WCF applications in IIS 7 and above by using WAS, see Hosting in WCF on MSDN.


Q)What is virtual Directory 
  A) By using IIS Manager , You can create a virtual directory for an web application that is hosted in IIS 7 . A virtual directory appears as root directory for the end users but actually it,s physical path may be an other directory or some other shared forder .  This approach enables you to publish Web content that is not located under the root folder of the Web server, such as content that is located on a remote computer. It is also a convenient way to set up a site for local Web development work because it does not require a unique Web site for each virtual directory.

Q) What is Application Pool recycling?
  A)  Some times the worker process may shows some error or some session may cause un expected result. When a unhealthy worker process occurs we can manually recycle the application pool instead of waiting for a scheduled recycle . When does all unhealthy worker process shutdowns and starts a fresh one

Q)What are the different security settings available in IIS?
A) Below are the commonly used IIS Security settings
1 Anonymous
2 Integrated Windows Authentication
3. Basic Authentication
4. Digest Authentication
5. Passport Authentication

Q)Identity of an application pool ?
 A) Identity of an application pool is the name of the service account under which application pool's worker process runs.By default , application pools operates under the network service user account, Which has low level user rights. You can configure application pools to run under one of the built-in user account

Tuesday, 12 January 2016

Integrating Microsoft Dynamic CRM with .Net Web-api

The Microsoft Dynamic CRM is one of the most effective and durable CRM Available now. Some times the organizations are not satisfied with just CRM , in order to make their process much easier, they are forced to create another costume applications like mobile apps and desktop applications even other custom CRMs . But each applications must be synchronized that they all should be work as connected systems in order to attain full use of distributed systems.
Here i am talking about the integration of Microsoft dynamic CRM with Web-api. Because web API's are more common now and use as the middle layer to communicate with different systems like, Mobile apps and other web sites , other CRMs etc.
In order to connect with Dynamic CRM there is a SDK provided by Microsoft which uses the CRM Services to communicate.I have explained below the step by step creation of web-api which retrieve the Data from Dynamic CRM

1. Create a web-api project 

  1. install CRM Sdk From NuGet
    or you can use
    Install-Package Microsoft.CrmSdk.CoreTools -Version 7.1.1

    command On Package console 
    The Microsoft SDK includes the architechture over view of CRM ,Entity,Services .The SDK will simplify the complexity of Dynamic CRM and which will speed up the develoupment time. The SDK is actually a group of tools which will enable us to extentds the Microsoft dynamic CRM functionalities . You can find more detauils about this in this link about microsoft dynamic CRM SDK  

  2. Create the entity classes which will be using for bind the CRM data
    also create the 'Request' and 'Response' Classes for pass request and response objects 

    1. Give the Dynamic CRM address on web.config
    You can directly give the url with in the code it self and
    <add key="CRMServiceUrl" value="http://CRMURL/XRMServices/2011/Organization.svc"/>

    5.In the 'HomeController' , change the inherited class to 'ApiController' 
            public class HomeController : ApiController

    6. Create a HttpPost method to retrieve data from CRM server
    copy and paste below code
public AccountResponse getCRMAccounts(AccountRequest objRequest)
AccountResponse objResponse = new AccountResponse();
IOrganizationService service;
ClientCredentials Credentials = new ClientCredentials();
Credentials.UserName.UserName = objRequest.UserName;
Credentials.UserName.Password = objRequest.Password;
Credentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials;
string CRMServer = ConfigurationManager.AppSettings["CRMServiceUrl"].ToString();
Uri OrganizationUrl = new Uri(CRMServer);
Uri HomeRealUrl = null;
using (OrganizationServiceProxy Serviceproxy = new OrganizationServiceProxy(OrganizationUrl, HomeRealUrl, Credentials, null))
service = (IOrganizationService)Serviceproxy;
if (service != null)
QueryExpression query = new QueryExpression
EntityName = "account",
ColumnSet = new ColumnSet("name",
EntityCollection entities = service.RetrieveMultiple(query);
// Iterate through returned collection.
objResponse.objAccountList = new List<Account>();
foreach (var c in entities.Entities)
Account objAccount = new Account();
objAccount.Name = c.Attributes["name"].ToString();
if (c.Attributes.Contains("telephone1"))
objAccount.Phone = c.Attributes["telephone1"].ToString();
return objResponse;
    7. Build the solution and run it on 'HTTP Requester' Plug in for Firefox

    and click post button then the request will pass to the program
    the below image shows that our program is connected the CRM server
    Once the connection with the CRM server is succeded then we are going to query out the entity the 'account' is the entity name wich we are going get from CRM and specify the name of the colloum which we want to retireve from the CRM entity
    QueryExpression query = new QueryExpression
EntityName = "account",
ColumnSet = new ColumnSet("name",

      Now We got the response 'Account' List from CRM server and we loop it and create a custom list for our convenience and shows it as output object 

CRM Account list is 
Issues I have faced when creating API's are as below

using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Client;
using Microsoft.Xrm.Sdk.Query

This Xrm is not defined even if I had given the CRM sdk reference to resolve this problem just change the target framework version initially my framework version was .NET framework 4.5 and the i have changed it to .NET framework 4.5.2 then the issue will be resolved 


 Please leave your valuable comments

Tuesday, 13 October 2015

MVC Interview Questions Part-2

This is the second part of the MVC interview questions , Firstly I thank you for the good response all my readers gave me. Keep reading cheers.

Q.Difference between MVC and MVP
       In MVC the controller handles all the requests in and out . The request comes directly to the controller and it handles the request and bind the result view
Whereas In MVP system is an evolved version of MVC ,here views receives all the UI request and Calls the presenter as needed , Presenter is also update the view with processed data


Q, What is the separation of concerns 
      It is the design principle for separating a computer program into distinct sections.Each section is separate concern . That is for example what we use 'Business layer ' in our project can be treat as a separate concern. An Interface project is also a separate concern .
  In MVC , The Model View Controller (MVC) is divided into three separate concern Logical group .
Model, Views, Controller. Each of them have different specific logical functionality.
I am not going into deeper in this vast area which is inappropriate in this 'separation of concerns'

 MVC interview question

Q.MVC4 Display modes 
           In MVC4 Microsoft has introduced display mode feature which will allow us to simplify how to implement different versions of view for different devices .If the requested browser is from mobile devices, which can be identify from user agent then the view engine first looking for '.Mobile.cshtml '
for example we have 'index.cshtml' and '' then the request from Mobile devices then the view engine automatically load the '' and if it is from other PC browser then the view engine will load 'Index.cshtml'
We can also register custom device modes
DisplayModeProvider.Instance.Modes.Insert(0, new DefaultDisplayMode("WinPhone")
ContextCondition = (context => context.GetOverriddenUserAgent().IndexOf
"Windows Phone OS"StringComparison.OrdinalIgnoreCase) >= 0)});
This is registering custom device model 

Q. What is scaffolding feature in MVC
   In MVC -5 Microsoft introduced scaffolding feature which make the developers life much easier  . That as a developer we are very much board with regular create update delete operation . In MVC 5 we dont need to worry that much the MVC will create theses controller and Views accordingly we only need to worry about modifying the automated code . the CRUD operations made easy with the scaffolding feature of MVC .
CRUD means nothing but, Create,Read,Update,Delete operation . Which is a cool feature on MVC.

Q.What is ASP.Net Identity
   In earlier days ASP.Net 2 introduce Membership approach which is the user is credential is saved in the sql database . The user can use the authentication details to login.. But the web trends always changing that is now there is everyone is connected to each other and they also want to connect and authenticate using the social media. and no need to create separate username and password for every system. So the inorder to bring the changing trend microsoft introduced the  ASP.Net Identity 
- One ASP.NET Identity System: Can be used across all the ASP.NET Frameworks like WebForms, MVC, Web Pages, Web API, SignalR etc.

- Ease of plugging-in profile data about the user: The user’s profile schema information can be integrated with the web application.

- Persistence Control: ASP.NET Identity system stores all user information in the database.

- Social Login Provider: Social log-in providers such as Microsoft Account, Facebook, Twitter, Google, and others can be easily added to the web application.

- Windows Azure Active Directory (WAAD): The Login-in information from WAAD can also be used for authenticating a web application.

- OWIN Integration: ASP.NET Identity is fully compliant with OWIN Framework. OWIN Authentication can be used for login. If you are new to OWIN 
Image Ref:

Q)what filters are executed in the end
 “Exception Filters”

Q) what are the file extensions for razor views
.cshtml: If C# is the programming language
.vbhtml: If VB is the programming language

Q) what are the two ways for adding constraints to a route

Using regular expressions

Using an object that implements IRouteConstraint interface

Q)What is bootstrap 
Bootstap is the Most popular HTML,CSS and Javascript framework for creating responsive ,Mobile-first website. Bootstap is very famous and free to download and use. It is very helpful in responsive designs

Q)Filter Overrides in MVC5

  MVC 5 has a new feature called Filer overrides ,it allows developer to replace certain filer types .If you created a global action  filters or  controller action filters then you could override those filters on a case by case basis at the controller action level .This allows you to set global or controller filters that apply in almost all cases and just override them in the few, specific places where those filters don't apply.
Ref :

Wednesday, 2 September 2015

Web-api Tutorial Part -1

Creating Web-Api

Hi, Everyone here i am again , now I am gonna discuss about the web-api . Web-api is the next level service preferred by everyone . The advantages that using web-api are, this is HTTP service ,can be consumed by many clients like Mobiles,tabs,browsers etc..

These days , Most of the peoples using smart phones and they usually use apps than browsers in their mobile. So the website and app should work synchronized . Most of the famous websites provide their apis . So creating your own api is not a bad thing right? we could learn how to create your own Web-api using Visual studio-2013

Actually it is very easy lets check it out , how to create a new Web-api

Creating the web-api project

File --> New --> Project and select web under visual C#

Select WebApi
Click ok and you will get the project files are auto created Delete ValuesController and we could create a new controller  
Create a new controller 
Select webapi2 controller 

Create a Model class and define 
A request and response which should e the signature of api through which we are getting and posting data
Create a HTTPPOST method to your controller and use the request and response class 
And Run the application then there is a default controller in Areas folder in your project inside helppage there is a controller HelpController ,this controller will help you to list out and sample out put and input data structure just type in the url  /Help 
While clicking a particular function it will shows the possible input and output Data structure 
There is many method to debug the api code the most easy way i felt that using HTTPRequester 
Which is a add-on to  create a http request and is very useful i am using this to debug my web-api
You can Call the api as given below and put a break point on the controller 
Invoke the api controller method through httprequester and you can see the data is passed to the api
The result came in the result window

I will explain the issues that i have faced when creating Web-api on next post 
Please leave comment if this post helps you .

Wednesday, 12 August 2015

Programming Life Hack

Through this post I would like , everyone to share their own ideas on programming that makes programmer's life easier . Every programmers have some secret weapons which makes them ahead of time. I would like to share my secret. Also i would like to hear from you folks. Let us share some tricks and tips for make programmer's life easy .

Note: This is not about how you become good programmer it is about how some simple tricks makes your programming life easy 

I would like to classify this area as below

a) Short key skills

There are a lot of cool shortcut keys in frame work . We could just practice few times
and become an expert . When you are so familiar with these short key, then your speed boost up about 25% . You could be faster and more effective just with a simple practice of shortcut keys and wen you became expert , your monitors appears as hacker's in movies

Note:- Not only the short key but also need to know the programming lol :)

I am Listing some short cut key I am using frequently if that helps you I would be grateful

Ctrl + G → Go to the line number
Ctrl +Tab → Select between the opened pages
Shift+Delete → Delete a line
Ctrl +C and Ctrl +V → Don't laugh , Everyone knows but a lot of people don't know the power this
                                    short key combination if you press Ctrl+C and Ctrl+V then you will get the                                           entire line copied and paste to next line .
Ctrl+Shift +V → Cycles through the copied texts .
Ctrl+Right Arrow → Skip trough the words.
Shift+Ctrl+Right Arrow → Select a word
Shift+End → Select a cursor point to the end of line
Shift+Home → Select a cursor point to beginning of the line .
Shift+Ctrl+Home → Select a cursor point to the beginning of the page.
Shift+Ctrl+End → Select a cursor point to the beginning of the page .
Ctrl+Home → Goto the beginning of the page.
Ctrl+End → Goto the end of the page
Ctrl+T → Interchange the character on both side of the cursor
Ctrl+K+K → Book Mark a code and remove book mark
Ctrl+K+P → Goto the book marked line
F9 → Put a break point in the cursor line
Ctrl+Shift+S → Save all
Ctrl+U → Change selected text to lowercase letters
Ctrl+Shift+U → Change selected text to Uppercase letter
F12 → Goto definition
Alt+F12 → Peek to definition
Ctrl+M+M → Toggle outlining (open and close a cursor section )
Ctrl+M+L → Toggle outlining of entire page
Ctrl+M+P → Stop outlining
Ctrl+K+C → Comment a selected section or cursor line.
Ctrl+K+U → UnComment the selected section or cursor line .
Ctrl+Shift+N → Add new item
Ctrl+Alt+L → Show solution explorer
Alt + Mouse → Select a vertical part of code .
Ctrl+Space → AutoComplete Intelisence .
Ctrl+- → Go to the previous courser position .

These are comes in my mind please add up what you have as comment

Split screens

Let us consider the scenario that we want to copy some thing from end of a long page to top of the page or code same as the function below , What we usually do is scroll down and up continuously but there is some feature present in .net IDE is split screens That helps us to view the desired portion blow and at the same time we could edit on other screen which is most helpful and time consuming
there is also a full screen option available in .net press Shift+Alt+Enter then you could edit your source code in this model which is also a cool feature 

Screen Grouping

There is a feature in .net IDE that we can group the screens vertically so that we could easily copy from one page to another or cross verify the different pages

b) Look before you leap

It is very hard to code as speed as Hugh Jackman in sawadfish . I dreamed like to do code as fast as he does in that movie. I practice hard as I am practicing my typing skills I realized that not only the typing skills need to know what should I write next .Soon after finish one line of coding , we should code the next line in mind . Always think ahead ,everyone can do that with a little practicing.
Every human being is blessed with tremendous brain power , sky is our limit. Plan your block of code ahead and type as soon as possible and surprise your co-workers. Always remember , Plan your next block of code ahead. If you practice this way , not only your coding your life will get better and better. Make a habit to plan ahead

c) Excel The Wizard

I don't know how many programmers uses the Excel as your coding companion , I am using it as my code generating tool .
Consider the scenario that we have to create a class which has more than fifty properties and we have to create the properties as per the Database table . What we usually do is copy and paste every single property one by one . which will time consuming and a boring process , also we have to cross check if miss something .
What I am doing is , I had created an excel file which have the equation to generate properties by simply copy and paste the column name from database , I can create variables with its data-type.

I will explain with an example so that every body could understand

Consider I have to create an entity class which have 48 variables

I have to create a class Transaction with all these properties
what I am gonna do is create a class name Transaction as below shown

next open my excel which I have created and is equipped with my formula to create properties

and then I am gonna copy and paste entire column name to my excel

   and we need data-type too right, so simply copy and paste data-types from your database table design, from there we can select all data-types of your column with one copy and paste it on excel

and you ca see all variables are generated . It is a vb code .
You can do as per your requirements now copy and paste to your class it will take about maximum 1 minute and is not boring also :)

I am listing my excel formulas which I had used in above example

Which is work only in Open office calc

For Creating the Data-types

A1 is copy pasted database Data-type

For creating the default Value

For creating the Variables

="Public "&D1&" As "&B1&" = "&C1

This is very simple example you can basically generate all type of repeating code using excel
Which is time saving and efficient . Reduced human errors also an advantage of this method. You can use excel in many ways think out of box...............

d) Advantages of copy and pasting

Don't underestimate the importance of copy and pasting in Software developing . Copy and paste not only helps you to save time but also helps you to develop a quality code. Because you are copying from a already tested and working code so the chances of getting error is very less.

Note:- Remember to remove programmer's name and date lol :)

Please leave your comment if this article helps you in anyway . If it helps you then I am very grateful . I am sure you also have some unique method to ease your programming and I would like to here it from you please share it with us as comment ..

Happy Coding..