Friday, December 11, 2015

What is .NET Core?

.NET Core is a set of libraries and a new common language run time. .NET Core is available as an open source software and it targets Microsoft,Linux and Mac. Microsoft has completely rewritten the existing .NET framework to create a light weight modular version of the .NET framework to support cross platform application development. .NET Core is modular because it is released as smaller assembly packages through NuGet. It's a subset of the full .NET framework as most of the unrelated vertical's of the previous .NET Framework versions are removed.

.NET Core is portable because you can package and deploy the CoreCLR along with the application and that eliminates your applications dependency on the installed version of the .NET framework.Using .NET Core,We can build different kind of application like web applications, console applications and native mobile applications. The .NET Execution Environment (DNX) provides a cross-platform run time host using which we can build applications that can run on different platforms.Applications running on DNX can target .NET Core or .NET Framework.

Wednesday, September 16, 2015

Click Once Deployment of Windows Console Application for Deployment and Auto Update

There are 4 main tasks for Click once deployment of windows Application deployment and auto update. They are
1)Creating Windows Application and configuring publish properties.
2)Creating a web site and virtual directory in the application
3)Enabling a Port(web site port created in Step 2) in windows fire wall by creating a Inbound rule.
4)Publishing the application.
Task 1:Creating Windows Application and configuring publish properties.
1)Create a Windows Application.
2)Right click on Project in solution explorer and select "Properties".It will display a project Properties screen.

3)In Properties click on Publish Tab,It will display the below screen.

4)Set the Publish location to a valid website address as shown above.
5)Provide the Publish version as 1 0 0 0 and select Automatically increment revision with each publish check box.
6)Configure Prerequisites,Updates and Options as shown below.
Prerequisites Configuration:
Updates Configuration:

Publish Options Settings:

Publish Options Deployment Settings:

Task 2:Creating a web site and virtual directory in the application
1)Open IIS through run command, the below IIS console will appear.

2)Add a web site from IIS by Right clicking on Sites and selecting Add Web Site option. Need to provide site name,physical path and port number. Check Start Web Site immediately check box.

Task 3:Enabling a Port(web site port created in Step 2) in windows fire wall by creating a Inbound rule.
1)Open a Windows fire wall from Control Panel.The below window appears.
2)Click on Advance settings,below window will be displayed.

3)Click on Inbound rules,below window will be displayed.
4)Click on New Rule in Actions. New Inbound Rule Wizard will be displayed as shown below.
5)Now Configure Rule Type as Port and click on next. It will display the protocol and Ports window. select TCP and Specific local ports radio buttons. Give the port number used in the web site created in step 2.Then click on Next button.

6)Select Action as Allow the Connection. Click on Next.

7)Select the Rule Profile options as below.Then,Click on Next.
8)Provide the Rule Name and Description as below and Click on Finish. It will create Inbound Rule with the name(AllowTrafficOnPort121) provided and allows the other machines to access the resources from the given port number(here 121 ).
Task 4:Publishing the windows application.
Please refer to Publish screen shots.

Click on Next
Finally you got the update ready to be installed.Clicking on Install will update the latest version of the windows console application.

Tuesday, July 28, 2015

Microsoft certification for .NET Technical Leads

I have spent some good time in analyzing pros and cons of getting a certificate and convinced that advantages of having a certification outweigh the disadvantages.
Having a certificate will indicate that you are interested to learn and improve on your career.Of course, there are chances of getting pay hike if you can show case your certification a right way.

I would suggest the technical leads who are working on .NET to get Microsoft Certified Solutions Developer (MCSD) certification.This certification is valid for 2 years.Microsoft is offering this certification in 5 Microsoft technology categories. 

 They are






Based on our area of expertise, we can select any of the above certifications. To pass MCSD certification, we have to select any 3 exams given under that category.

For example,to get MCSD: Web Applications certification, we have to pass below exams.

 Exam 70-486     ---- Developing ASP.NET MVC Web Applications

Exam 70-480    ----- Programming in HTML5 with JavaScript and CSS3
      (or)
Exam 70-483    ----- Programming in C#

Exam 70-487    ----  Developing Microsoft Azure and Web Services

Thursday, July 16, 2015

Top 5 .NET websites all the developers should know

Here is the list of best 5 websites I am recommending for all .NET developers.


1)MSDN Library: MSDN should be the first point of reference for learning any .NET technology as it is from the product owner of .NET technology. Whatever the websites I refer to learn a certain concept, I wouldn't be satisfied unless and until I cross check that with MSDN website.


2)Code Project : Code Project is a community website. It has great content on different technical languages. I refer this web site for .NET developers for learning .NET skills like ASP.NET, C# and WCF. As most of the articles are submitted by common .NET developers they are very easy to understand.


3)C# Corner : This is also a great website for .NET learners and developers. As most of the articles are submitted by community developers, they are easy to understand.This web site provides you lot of code snippets with different examples for every concept.


4)StackOverflow: This is one of the best web site to refer to when you encounter any practical problem with your .net development. It has answers to thousands of practical problems faced by .NET developers.



5)Channel9 : Channel9 has great video tutorials on .NET technologies delivered by .NET experts.

Sunday, May 3, 2015

Frequently asked interview questions for Dot Net Developers

Here I compiled a list of frequently asked interview questions for .NET developers. I am looking forward to Update the blog with the answers to the questions listed here and add more interview faq's on latest Microsoft technology skills.Feel free to provide your suggestions for improvements.

C#:

1)What is a dictionary? 
2)What is a Hash table?What is the difference between dictionary and hash table?
3)What is Polymorphism?
4)What is encapsulation?
5)Difference between Destructor and Dispose?
6)What is a delegate?
7)What is an Extension method?
8)How to add functionality/logic to the existing C# method without modifying it?
9)Whats is a Factory pattern?
10)What is Threading?
11)Lock and Mutex
12)What is an observer design pattern
13)Different Types of design patterns
14)Early binding and late binding
15)New features in .net 4
16)Example for factory and abstract factory
17)Boxing and Unboxing
18)What are the different types of Collections in C#?
19)Explain about C# generics.
20)Can We create an object for an abstract class? 
21)What is the difference between a static class and singleton?
22)What is a sealed class? Can we create an object for sealed class?
23)Can we create an object for static class?
24)Can we declare instance variables in Static class?
25)Can we declare static methods and variables in non static class?
26)Is it possible to declare class as abstract class if it doesn't have any abstract methods?
27)MVC design pattern?
28)What is the difference between Var and Dynamic key words?
29)What is the difference between String and String builder?
30)What is the difference between Array and ArrayList?


ASP.NET:

1)Explain ASP.NET page life cycle.
2)Difference between Javascript and Jquery?
3)What is Cashing and different cashing techniques.
4)Explain Authentication and Authorization.
5)What is a Single Sign on?
6)What is Web Farm?
7)How session is sent to client?
8)How ASP.NET MVC frame work works?Can view directly talk to model?
9)Advantages of ASP.NET MVC framework over ASP.NET web farms.
10)What is the difference between HTTP Module and HTTP Handlers?


WCF:

1)What is Service Oriented Architecture?
2)What is End Point?
3)What is binding in WCF?
4)Difference between basichttpbinding and wshttpbinding?
5)What is a Service contract?
6)What is Operation Contract?
7)What is a fault contract?How to implement custom fault contract?
8)What is message contract?
9)What is Data Contract?
10)What is KnownType?Explain with a real time example.
11)Significance of REST services ?

General:

1)What is JSON?
2)Different requirement elicitation techniques.
3)Different estimation techniques.
4)What is most challenging task you have worked on in the current project?
5)What are the different SDLC models you have worked on?


SQL Server:


1)Write stored procedure syntax.
2)What is Sql profiler?
3)Find out the department name which has highest number of employees?
4)Find the employee with 3rd highest salary.
5)Difference between Delete and truncate.
6)Difference between Clustered Index and Non Clustered Index
7)Is index can be created on a View?
8)What is a Temporary table?
9)What is an Execution plan?
10)Explain about OUTER Joins.
11)What is SQL Trigger?
12)What are the different advantages of SQL stored procedures?
13)How to implement exception handling in Stored procedures?
14)Explain about different query optimization techniques.
15)What is SQL Cursor?

Saturday, April 11, 2015

Set up/Configure your own Team Foundation Server(TFS) for free

Team Foundation Server(TFS) has been one of the popular and widely used source control systems in the software industry. TFS is a proprietary software unlike SVN and Git the other popular source control systems.Individual's and small companies instead of purchasing licensed TFS used to turn to open source version controls like SVN for maintaining their source code . But now the Microsoft is giving TFS for free through its Visual Studio Online Cloud services, though with some restrictions on commercial use.

It's a great opportunity for the people who wanted to experiment,learn and set up their own TFS for free.
Following the below steps anybody can easily set up the TFS with the help of Visual Studio Online.

1)Visit the visualstudio.com website.Click here for details on visual studio online sign up link.

2)Click on the Sign Up link as shown in below image.
3)It will take you to login.live.com for Microsoft account Sign in.Sign in with your Microsoft account credentials if you already have,otherwise Sign up for Microsoft account with the help of Sign up now link as shown in below image.


4)Once user successfully logins with the Microsft account,Create a Visual Studio Online Account page will be displayed.Now the user has to enter the mandatory details and Account URL as shown in below image.


5)After entering the details click on Create Account button to create your visual studio online account.Now your account is created with the URL entered.This URL is your source control URL for all the future projects.

Now create your team project where your code is hosted and work will be tracked.
Enter the name of the project, Select the process template as Agile or Scrum for work tracking and finally select version control as Team Foundation Version Control.



6)Click on Create project.Now MyExperiments project is set up under TFS version control.This free Visual Studio Online account supports up to 5 users.


Thursday, March 26, 2015

Coding standards

Coding standards are the set of rules which makes the development of the code consistent and helps the developers to understand the code easily.They also helps us in enforcing the best programming practices.

Following are the some of the coding standards every programmer should follow.

1)Use exception handling and Logging.

2)Use naming conventions for classes,Interfaces,methods and variables.

3)Use object oriented programming principles.

4)Remove redundant code.

5)Add meaningful comments to Types and methods.

6)Avoid hard coded strings,instead use string constants.

7)If there is any lengthy method,more chances are that it is going to have errors.So re-factor them to smaller meaningful methods.

8)Use IsNullOrEmpty property of string to check if the value of the string is null or Empty.

9)Give meaningful names to classes and methods.

10)Use the Using statement to Dispose the objects as soon as they go out of scope.

11)Remove unused using's and assembly references.

12)Use #region to outline the block of code so that you can expand and collapse.

13)Every object(class) should have a single responsibility.

Ex:In below example,I have a DateManager class which is handling too many responsibilities.They are

a)Date manipulations and conversions.:These actions class supposed to be doing.I dont have any problem with this.

b)Writing exceptions to text file:This DateManager shouldn't be doing.Here the class is overloaded with multiple responsibilities.For proper maintenance and design(separation of concerns) this code should be moved to another class called Logger.cs

public class DateManager
{

public string ApendDates(string dateInput, string toDate)
{
try
{
var fromDateTime = DateTime.ParseExact(dateInput, "MM/dd/yyyy", new CultureInfo("en-US"), DateTimeStyles.None);
var toDateTime = DateTime.ParseExact(toDate, "MM/dd/yyyy", new CultureInfo("en-US"), DateTimeStyles.None);

return fromDateTime.ToString(CultureInfo.InvariantCulture) + "---" + toDateTime.ToString(CultureInfo.InvariantCulture);
}
catch (Exception ex)
{
const string filePath = @"C:\Exceptions.txt";

using (var writer = new StreamWriter(filePath, true))
{
writer.WriteLine("Message :" + ex.Message + "<br/>" + Environment.NewLine + "StackTrace :" + ex.StackTrace +
"" + Environment.NewLine + "Date :" + DateTime.Now.ToString(CultureInfo.InvariantCulture));
writer.WriteLine(Environment.NewLine + "-----------------------------------------------------------------------------" + Environment.NewLine);
}
}
return null;
}

public DateTime? ConvertToDateFormat(string dateInput)
{
try
{
var dateOutput = DateTime.ParseExact(dateInput, "MM/dd/yyyy", new CultureInfo("en-US"), DateTimeStyles.None);

return dateOutput;
}
catch (Exception ex)
{
const string filePath = @"C:\Exceptions.txt";

using (var writer = new StreamWriter(filePath, true))
{
writer.WriteLine("Message :" + ex.Message + "<br/>" + Environment.NewLine + "StackTrace :" + ex.StackTrace +
"" + Environment.NewLine + "Date :" + DateTime.Now.ToString(CultureInfo.InvariantCulture));
writer.WriteLine(Environment.NewLine + "-----------------------------------------------------------------------------" + Environment.NewLine);
}
}
return null;
}
}


14)Follow the KISS(Keep It Simple Stupid) and DRY(Don't Repeat Yourself) principles.

a)We should always try to keep the code simple and avoid complexity.

b)We should make sure that same code is not repeated in more than one place in the project.
ex:Error logging code is repeated in  ApendDates and ConvertToDateFormat methods.