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.

Fault Contract’1 was unhandled by user code: Solved

For a training purpose I was trying a basic demo on fault contract in WCF and to be surprised I Got below error while throwing FaultException.

clip_image002

It’s not that 1st time I was working on Fault Contract but this error was irritating. After some investigation I found there was some issue in visual studio 2013 setting. So to solve this in Visual Studio go to Tools->Options.

In General tab from Debugging section uncheck following options,

  • Enable the exception assistant
  • Enable Just My Code
  • image

    Changes in Visual Studio setting should solve the problem. Keep in mind that above error can occur due to other reasons also. Visual setting debugging option may be one way to solve above said error. I hope you find it useful. Thanks for reading.

    Getting started with Node.js development in Visual Studio

    Setup Environment on Windows machine for Node.js Development [Set up Sublime Text]

    Yes you love node.js. You love event driven development and yes multi thread is old fashioned now. Your new found love is ASYNCHRONOUS. Asynchronous everything, even reading file system. As all we know Microsoft loves Developers. So in Build they decided to give node.js development support in Visual Studio 2012 and Visual Studio 2013.

    In this post we will take step by step look on setting up Visual Studio for node.js development. You need to follow below steps,

    Step 1

    Download in install Node.js from http://nodejs.org/

    Step 2

    Next download and install Node.js for Visual Studio from here,

    https://nodejstools.codeplex.com/releases/view/114437

    You need to make sure that you select correct option to download. I am going to install Node on Visual Studio 2012.

    image

    After successful installation you will get below confirmation message of successful installation.

    clip_image001[6]

     

    After installation above said pieces you are good to go and start developing Node.js in Visual Studio. On launching Visual Studio in JavaScript language category, you will get various project templates related to Node.js

    image

    There are five different project templates available.

    image

    You can create Node.js application web based by selecting, Blank Node.js Web Application project template.

    clip_image002

    On successful creation of project you will get following files in project. Solution explorer will look like below,

    clip_image003

    server.js will contain code and entry point of application. By default server.js contains following code

    clip_image002[6]

    You just need to press F5 to run with debug or Ctrl+F5 to run without debugging. This default code will give you following output in browser

    clip_image003[7]

    And whereas debugger is listening on port 5858.

    image

    So we experienced that working with Node.js in Visual Studio is very smooth. You just need to press F5 to run application and can put a breakpoint and debug the code. As you see in below image that breakpoint is being hit.

    image

    You can find that intellisense will work as expected. This completely support intellisense for Node.js

    image

    Other thing you will notice that Node.js debugger support complete stack trace.

     

    clip_image002[8]

     

    Exporting existing Node.js project

    You can create existing Node.js project from existing Node.js project by creating a project choosing template From Existing Node.js code

    clip_image002[10]

    On next screen you need to browse to existing project folder. You can also select files types to be included. After providing these two input click on Finish.

    image

    You will find existing project has been exported to new project.

    In this way you can set up Visual Studio 2012 to work with Node.js development. I hope you find this post useful. Thanks for reading.