How to set up a conversation with Visual Studio?

As the complexity of my web project grows, I understand that loading external JavaScript libraries manually, is error prone, takes a lot of time and makes the project less maintainable over time.

Although Visual Studio has a NuGet package manager, it is not as powerful as a gazebo. Also, not all external libraries are released on NuGet.

But there is no clear help on how to set up a conversation with Visual Studio. Please, help!

+7
javascript visual-studio bower bower-install
source share
2 answers

enter image description here

As the complexity of my web project grew, I realized that loading external JavaScript libraries manually was error prone, time-consuming, and made the project less maintainable over time.

Although Visual Studio has a NuGet package manager, it is not as powerful as a gazebo. Also, not all external libraries are released on NuGet.

So, I decided to take a decisive step and start with a gazebo.

My project structure is now much cleaner and easier to maintain.


Here I list the steps that we must follow to set up a conversation with Visual Studio.

Detailed instructions for using the gazebo are already available at http://bower.io/#install-bower . Here I will list the steps that I have taken for

  • - install the gazebo

  • - configure it using Visual Studio

  • - download sample package - (AngularJS)


Bower requires node, npm, and git for windows.

Before you begin, set the following


Step 1

Open a command prompt and run the command

npm install -g bower

enter image description here

The above step may fail if you are behind a corporate proxy server. Add proxy server to npm, run the following 2 commands from the command line

npm config set proxy http://proxy.myCompany.com:80

npm config set https-proxy http://proxy.myCompany.com:80

After execution, try installing bower again


Step # 2

Go to the Visual Studio Project folder from the command line.

Run command

 bower init 

enter image description here

  • Include this file in your Visual Studio project. You may have to click on โ€œShow all filesโ€ in the โ€œSolution Explorerโ€ menu.

enter image description here


Step # 3

Create a .bowerrc file using notepad with the following configuration and save it in the Project Visual Studio folder

 { "directory": "scripts/bower_components", "proxy":"http://proxy.myCompany.com:80", "https-proxy":"http://proxy.myCompany.com:80" } 
  • Include this file in your Visual Studio project.
  • Edit this file to set the directory for packages to be downloaded
  • Add proxy settings if you are working with a corporate proxy. Else delete last 2 lines for proxy and https proxy

enter image description here


Step # 4

To load AngularJs, run the command

 bower install angular โ€“save 

This will add a line to bower.json.

enter image description here

Step number 5

The package will be downloaded from the bower_components directory by default. (or in the directory specified in the .bowerrc file)

Make the entire package directory run in a Visual Studio project.

  • Click Show All Files
  • Right-click the new downloaded package and click "Include in Project"

enter image description here

enter image description here

Step # 6

Finally add a link to the new package to your index.html

enter image description here


+13
source share

I found that I also need to configure git to use a proxy server:

git config --global http.proxy http: // username: password@proxyURL : 8080

After that, the gazebo worked in VS 2015

+2
source share

All Articles