Showing posts with label VS2008. Show all posts
Showing posts with label VS2008. Show all posts

Monday, 1 March 2010

WCF: svclog viewer SvcTraceViewer.exe

Fire up SvcTraceViewer.exe located under:

C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin

OR just run via your VS console window and type in "svctraceviewer"

VS2008: The breakpoint will not currently be hit. No symbols have been loaded for this document.

My VS instance crashed while I was trying to add a WCF service. Had to terminate the process. But when I restarted, I noticed strange behaviours with the IDE. I could no longer debug my project and would receive an error stating that "The breakpoint will not currently be hit. No symbols have been loaded for this document."

A bit of googling found this article.

The solution for me was to:

1. start debug
2. ctrl+alt+u.
3. Look for project in list and note path.
4. Close VS.
5. In explorer navigate to cache location in step 3, delete location of the cache usually under C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\xxx
I just deleted everything in root.
6. Deleted both bin and obj folder of each project.
6. Restart VS
7. Rebuild




Tuesday, 21 April 2009

VS2008: Generate new GUID quickly

Source: http://mundeep.wordpress.com/2008/03/27/quickly-generating-guids-in-visual-studio-2008/

One of the common tasks involved when creating sharepoint solutions is the generation of GUIDs. Visual Studio comes with a tool called GuidGen that lets you create GUIDs however it is annoying having to leave the Visual Studio environment.

I believe Visual Studio 2005 used to have it as an option under the Tools menu however i haven’t found where i can add the same shortcut in Visual Studio Team System 2008 (though i do notice that Visual Studio 2008 Professional DOES have a “Create GUID” shortcut under Tools - i’d still prefer the macro shortcut for ease of use especially when creating a lot of features).

I have however found a nifty alternate solution by Leon Zandman that describes creating a Macro to insert a guid into your current file. I’d just like to clarify some of the steps for those that haven’t dealt with Macros in Visual Studio 2008 before.

  1. Load Visual Studio 2008 and goto Tools -> Macros -> Macro Explorer (Alt-F8 for short)Macro Explorer
  2. Right-click on “Macros” then select New Macro Project
  3. Name your project (eg. GUIDGenerator) and choose a location to save it (note no space allowed in Project Name).
  4. This should give you a new project with a “Module1″ sitting underneath it. Right-click on “Module1″ and select “Rename” to give it a more meaningful name (eg. GUIDGenModule).
  5. Double-click on the newly renamed module and you should be shown the Visual Studio Macro IDE.
  6. Enter the following code (the “D” in ToString can be customised see Leon’s article):
      1. Sub Create_GUID()
      2. DTE.ActiveDocument.Selection.Text = System.Guid.NewGuid().ToString("D").ToUpper()
      3. End Sub
  7. Save and close the Macro IDE.
  8. Back in the main Visual Studio window goto Tools -> Options
  9. Goto the “Keyboard” option under the “Environment” tab.
  10. In the “Show Commands Containing” text box type in “Create_GUID”
  11. Select the Macro sub that you just created from the list (it should be the only one)
  12. Click inside the “Press Shortcut Keys” textbox then press your desired keyboard shortcut for inserting a GUID (eg. Alt+G as Leon suggested makes a lot of sense).
  13. Ensure the “Use Shortcut in” option is “Global” and click on “Assign”
  14. Close the options window and you should be able to start using your keyboard shortcut to quickly insert GUIDs into text!
  15. If you have any other Visual Studio windows open at the time you will need to close them and reload for the macro for the macro to be loaded (or you can goto the Macro Explorer window and manually load your Macro project)