How to Clone a Git repository in Visual Studio

In my trainings, often I get a question from junior developers that how to clone a Git repository in the visual studio? Perhaps it may be very simple for senior developers, however for the developers who struggle to get it right steps are discussed below,

Step 1

Find the URL of the remote git repository. For GitHub repository URL can be found as shown in the image below. Copy the URL from here.

image 

Step 2

Launch Visual Studio and from the View select Team Explorer. In the Team Explorer window select Clone.

clip_image002

On clicking Clone, you will get an option to provide the URL of the Git repo and the choose folder in which repository will be cloned. In the URL section paste the remote repository URL as whon in the below image:

clip_image004

As the last step click on the Clone and the remote Git repository will be cloned in the Visual Studio in the given folder. If everything goes right you will get success message as shown below.

clip_image006

I hope it helps. Thanks and Happy Coding.

An error was raised by libgit Category =Ssh error: solved git for Visual Studio

Have you come across the error as shown in below image?

clip_image002

You get the above shown error in Visual Studio while pulling changes from the git server. This error causes because you have local changes without the commit. In this scenario the visual Studio does not give very readable error message. Perhaps you may want to use git command for pull for more information on the error.

clip_image003

The git pull command clearly says that either commit the changes or stash them. If you are not sure about the local changes then better option is to stash them. Local changes can be stashed using the git stash command.

clip_image004

After stashing the local changes (you can commit also) run the git pull command to pull the remote changes from the git server. You should not get any error doing pulling the latest changes.

Hope it helps. Happy coding.

How to use DebugView to Log Entity Framework

In this post I will show you to use DebugView to log the Entity Framework. For detail discussion on the same topic you may want to learn more here:

Logging in Entity Framework on Steve Smith Blog

Profiling Database Activity in the Entity Framework by Julie Lerman

Download DebugView , unzip it and Run it as administrator. In Capture menu select the options as shown in below image,

image

Once the debugview is configured, you should configure the DataContext class as shown below. Enable database log to print on the debug window.

image

As the last step run the application using Entity framework without using Visual Studio or without attaching Visual Studio Debugger. In Visual Studio run the application using Ctrl+ F5. You should able to view the Entityframework log in Debugview as follows:

image 

The Debugview can be your good friend when you stuck with performance issues and want to log the queries.

Happy Coding.

Unable to index file: Permission Denied error in git add command

While working on an application, I had to commit changes to local Git Repository. It was usual task and I started with following command,

git add –A

To surprise git add command gave me error as shown in image below. Error message was clear that to a particular file there was Permission denied.

clip_image002

Note: I was working on a MVC application which had local database attached. Name of database was MoviesRTM.mdf.

I tried to commit using Visual Studio 2013 as well. Here also I got same error as shown in image below,

clip_image004

This can be solved by two ways either shutting down IIS Express or restarting Visual Studio. I was using IIS Express to host MVC application. You can shut down IIS Express by right click on IIS Express and click on Exit from context menu.

clip_image006

If this option is not working then try restarting Visual Studio.

Note: Restarting Visual Studio or Shutting down IIS Express may worked in this scenario because permission denies error was on a database file (extension mdf). And database was locally created.

After shutting down I was able to run git add command successfully.

Happy coding.

Getting Started with Git and GitHub

 

 

Read complete article on Falafel Blog

Who is not talking about Git or GitHub? In one of our recent user group meetings, someone asked how many Pull Requests have you done so far in any of open source projects on GitHub. I realized many developers in the room were puzzled with the phrase Pull Request. In this post I will explain some basic Git terminology and explore basic Git commands which will help you get started with Git. In a later post I plan to show you how you can work with Git-based Source Control and Visual Studio 2013.

Let us start with understanding basic terminologies:

Repository

A Repository  is a space where projects reside. Repository can be on a local computer or at an online host like GitHub or Team Foundation Server (TFS). If you are working in project then a Repository is basic unit of working . It will contain all the files, images etc. needed for the project. It should always contains a readme file, which describes the project

Read complete article on Falafel Blog

Lenovo ThinkPad T440P: My next companion

image

A batsman grow with his bat, a writer grow with his pen and a programmer grow with his machine. I was my gifted my first desktop by my father back in year 2003. That was assembled desktop with following configurations,

Processor: Pentium 3 1.7 GHz ||RAM: 128 MB || Hard Disk: 40 GB || 17 inch monitor || Assembled

I wrote first program on that assembled desktop and since then have worked on different kinds of desktops and laptops. I have worked on Dell Latitude, Lenovo ThinkPad etc. but never own them. On Friday 9th May 2014, I bought new machine for me. After bit of research online, for me Lenovo ThinkPad T440P came as a best choice for this time. This is one of the best available in market at this given time.

clip_image002

First thing you will notice is, it is not very sophisticated machine. In look it is very raw and a feel is guaranteed when you type codes using its keyboard.

Configuration of this machine is as follows,

Processor: Intel i7, 4th Generation||RAM: 16 GB || Hard Disk: 500 GB || 14 inch display || l3 cache || Windows 8 professional || Lenovo

 

clip_image004

One of the best is its keyboard and supported 1366*768 resolution display. Due to 14 inch screen size it is small and light. If you are a frequent traveller, this is your machine.

clip_image006

This machine is available in Lenovo stores throughout India. Rather buying it online, I bought it from a Lenovo store in NCR. I am very excited for my new companion Lenovo, ThinkPad T440P. Now why I am waiting let’s start coding.

First look of book: Designing Evolvable Web APIs with ASP.NET by Glenn Block

In India order this book from Amazon here

You become what you read

In this era of Kindle, tablets and EBooks, I proudly consider myself as real book lover. I get more connected to real book than any EBook on any trendy device. In order to purse my passion of collecting good books, toady I got WEB APIs book with ASP.NET by Glenn Block. Even before I start learning from this book, I am sure this book will teach me many good things about HTTP, REST and WEB API.

I got book delivered from Amazon this afternoon. It is summer in Delhi and the Sun it at its best yielding temperature 45 degree centigrade. I had to go out in this weather to collect book but trust me it was worth going out.

clip_image001

I thank from bottom of heart to Glenn Block for this wonderful gift. I can’t express in words that how I am going to enjoy and learn this book.

This book got great credential since it is authored by veterans like Glenn Block Pablo Cibraro pedro Felix Howard Dierking Darrel Miller

clip_image002

In India order this book from Amazon here

There are 17 chapters in this book. They are as follows,

  1. The Internet , the World Wide Web , and HTTP
  2. Web APIs
  3. ASP.NET Web API 101
  4. Processing Architecture
  5. The Application
  6. Media Type Selection and Design
  7. Building the API
  8. Improving the API
  9. Building the Client
  10. The HTTP Programming Model
  11. Hosting
  12. Controllers and Routing
  13. Formatters and Model Binding
  14. HTTP Client
  15. Security
  16. The OAuth 2.0 Authorization Framework
  17. Testability

I am fortunate to see evolution of WCF SOAP to WCF REST to Web API. I have not started reading yet but at the very high level I perceive this book as one of the greatest guide to learn HTTP Services. This book helps to create Web APIs harnessing the power of HTTP. I strongly recommend this book, if you are willing to create REST Services.

Our hero Scott Guthrie is also impressed by this book and he has said something like below about this book,

clip_image002

So what are you waiting for? Go and grab your copy and start learning and coding. Great job by Glenn and other authors.

In India order this book from Amazon here