Showing posts with label visualstudio. Show all posts
Showing posts with label visualstudio. Show all posts

March 11, 2014

Open Visual Studio IDE from Run command of your choice ( when you have 2 different versions of Visual Studio)

Question:
When you have two versions of Visual Studio installed on the same machine, for example Visual Studio 2010 and Visual Studio 2012, you want to always open Visual Studio 2012 as default?

Solution: 
When you have two versions of Visual Studio installed, say first you installed Visual Studio 2010 and then installed Visual Studio 2012. If you are using shortcut to open Visual Studio IDE
Start - Run - devenv.exe
By default Visual Studio 2010 will be opened. As Visual Studio 2010 was installed first and a register entry was done.

Now that you have installed Visual Studio 2012 without uninstalling Visual Studio 2010, this registry entry is not made for Visual Studio 2012

You can make Visual Studio 2012 to open as default, by modifying the registry entry. See below the steps.
  • Click on Windows Start button.
  • Type regedit.exe in the search text box, regedit.exe will appear. 
  • Click on the regedit.exe. This will open the Registry Editor.
  • Navigate to the following path in the left section
    •  HKEY_LOCAL_MACHINE => SOFTWARE => Microsoft => Windows => CurrentVersion => App Paths => devenv.exe
  • Click on devenv.exe you will see the default key on the right section.
  • Double click on default to change the value.
  • In this case for Visual Studio 2010 the value would be  (C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe)
  • Change this value to the path where Visual Studio 2012 devenv.exe is located, in this case (C:\Program Files(x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe) and click Ok.
  • Close Registry editor.
  • Now when you type devenv.exe from Run it is open Visual Studio 2012.
Following are default path where Visual Studio IDE is installed by default 

Visual Studio 2008
C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe

Visual Studio 2010
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe 

Visual Studio 2012
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe 

Thanks,
Hussain Patel

January 2, 2014

Debugging a Javascript in ASP.NET

There are two ways you can debug a javascript code in ASP.NET (visual Studio IDE)
I. Usingthe Internet Explorer Process  in the Attach to Process window
II. Using the debugger keyword.
Method I
  • In the Visual studio IDE open javascript .js file  and a breakpoint at the line you want to start debugging the code.  Now click on the menu (Debug | Attach to Process) on the top to open the Attach to Process dialog window (see below) select the  Internet Explorer process (iexplore.exe) from the list of available process a. Execute the code you want to debug in Internet Explorer.
Method II
  • In the Visual studio IDE open javascript .js file  and type the keyword debugger where you want the code to break in to debugging. this
  •  . Write your JavaScript and place the debugger keyword where ever you want the code to break into debugging. The JavaScript interpreter hits this  keyword and halts execution and returns the control back to the IDE. This is like setting a breakpoint inside of Visual Studio.
Note: you must enable script debugging in Internet Explorer to be able to debug. Go to Internet Options inside Internet Explorer and then go to the Advanced tab. Uncheck Disable script debugging (Internet Explorer).

How to completely remove TFS (source control) bindings from a visual studio 2008 solution

There are two ways to remove source control bindings for a solution:
1. Open the solution in VS, then click on File Menu – - >> Source Control –>> Change Source Control and then unbind and/or disconnect all projects and the solution. This changes will remove all bindings from the solution and project files on the local folder.
This solution when distributed or provide will not poup for TFS connection or TFS ofline when opened in VS IDE.
Once this is done you can again you can switch the Souce Contro provider in Tools -> Options -> Source Control -> Plug-in Selection) to get TFS
2. The simplet way to unbind a solution from TFS is to, open the solution you want to clean in VS IDE and remove the TFS Plugins from IDE using Tools menu –>> Options –>> Source control –>> Plug-in Selection. Select None from the dropdown and click ok. Visual Studio will ask to remove source controls bindings
Close the solution and reopen the solution. THe solution is now completely unbinded from TFS..
signed off
Hussain Patel