Bookmark and Share

Team Explorer SP1 Upgrade Fail

by KodefuGuru 19. January 2010 14:51

I received an email from a coworker today. She received a new computer and was having trouble viewing work items in Visual Studio. When she tried to open one up, she would receive the following error.

Could not load type 'Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemTypeDeniedOrNotExistException' from assembly 'Microsoft.TeamFoundation.WorkItemTracking.Client, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

She had Visual Studio 2008 SP1 installed, and she was obviously connecting to Team Foundation Server. I then decided to look at my version of Team Explorer and compare it to hers. In my installed products (under Visual Studio, Help, About) I had “Microsoft Visual Studio 2008 Team Explorer - ENU Service Pack 1 (KB945140)” and she did not.

The updates to Team Explorer come from Visual Studio 2008 SP1, so my best guess is that her system had SP1 installed before Team Explorer was installed. If you ever encounter this problem, the fix is to reinstall Visual Studio SP1.

Bookmark and Share

Tracking Items in Solution Explorer

by KodefuGuru 26. June 2009 15:27

Have you ever debugged a large project you didn’t create? If so, you’ve probably gotten lost in the vast jungle of code that was once some poor programmer’s paradise. This vast jungle is full of cannibalistic tribes and wild animals waiting to tear you to pieces. Your only hope for survival is your ability to navigate the solution tree, relying on your wits to circumvent the illogical paths of code that “Go To Definiton” has guided you down.

Luckily, Visual Studio 2008 will provide you a guide if you ask for it. Open Tools | Options… | Projects and Solutions | General. Then, check the box for “Track Active Item in Solution Explorer.”

TrackActiveItem

After you have pressed okay in this dialog, when you have a file opened in the editor, the Solution Tracker will automatically select it. The one catch I’ve found is that if the project is contained within a solution folder, the folder must be open.

Bookmark and Share

GacUtil, MPF, and CSProj

by KodefuGuru 30. April 2009 10:53

Yesterday, I wrote about running GacUtil from within the AfterBuild target, due to some constraints with MPF and T4.

I discovered that the path I provided was wrong. It's the only GacUtil.exe under the Microsoft.NET folder, but it won't register the assembly. Since I wasn't sure which path I should be using, I used the GacUtil task from MSBuild Community Tasks. Here is the relevant code it uses to retrieve the path to gacutil.exe:

protected override string GenerateFullPathToTool()
{
    
return ToolLocationHelper.GetPathToDotNetFrameworkSdkFile(ToolName, TargetDotNetFrameworkVersion.Version20);
}
protected override string ToolName
{
    
get { return "gacutil.exe"; }
}
This was fine, but it turns out that you get an error from regpkg.exe if the assembly is location in the GAC if you're trying to generate from a path.
regpkg : warning : The Assembly specified at [Path]\[Assembly]cannot be loaded because an alternate copy with the same identity exists in the Assembly probing path at 'C:\WINDOWS\assembly\GAC_MSIL\[Assembly]\1.0.0.0__7c2bf94927fd6e28\[Assembly]. The Assembly at 'C:\WINDOWS\assembly\GAC_MSIL\[Assembly]\1.0.0.0__7c2bf94927fd6e28\[Assembly] will be loaded instead.
regpkg : error : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
  Could not load file or assembly '[Assembly], Version=1.0.0.0, Culture=neutral, PublicKeyToken=7c2bf94927fd6e28' or one of its dependencies. The system cannot find the file specified.
To fix this, I made the GacUtil uninstall the assembly in the BeforeBuild target. However, I kept receiving the same error. Generating a diagnostic log from MSBuild showed me the actual culprit: the RegisterManagedPackage target builds after the AfterBuild target. I fixed it by making AfterBuild depend on RegisterManagedPackage. I've pasted the final, relevant script below. Note that the RegPkg command in the AfterBuild is used to generate installer wix. TargetName is used in the GacUtil uninstall because it requires the name without the extension.
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" />
<
Target Name="BeforeBuild">
   <
GacUtil Command="Uninstall" Assemblies="$(TargetName)" ContinueOnError="true"/>
</
Target>
<
Target Name="AfterBuild" DependsOnTargets="RegisterManagedPackage">
  <!--
.wix is specified instead of .wxi because the RegPkg task requires it to generate the wix script. -->
   <
RegPkg ItemToRegister="$(TargetPath)" ProductVersion="$(TargetVSVersion)" SDKVersion="$(VsSDKVersion)" OutputFile="..\Installer\RegistryEntries.wix" Unregister="false" UseCodeBase="false" UseRanu="false" />
   <
GacUtil Assemblies="$(TargetPath)"/>
</
Target>
Bookmark and Share

GacUtil from Project File

by KodefuGuru 29. April 2009 17:17

Due to circumstances involving a MPF package and Text Templating (t4), I had to add an assembly to the GAC after compiling if I wanted to be able to run the generator in the VS Experimental. So, I added the following line to the AfterBuild target of the csproj file:

<Exec Command="gacutil /i $(TargetPath)"/>

Unfortunately, I received the following error when I compiled: 

Error 155 The command "gacutil /i [PathToDll]" exited with code 9009. C:\Projects\AperioVisualStudioAddins\AperioVisualStudioAddins\AperioVisualStudioPackage.csproj 202 2 [DllName]

The problem is that when Visual Studio is building the project, it does not have access to the path. The way to make it work is to specify the fully qualified path and filename to gacutil.

<Exec Command="C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\gacutil.exe /i $(TargetPath)"/>

Bookmark and Share

Team System 2010 Overview

by KodefuGuru 21. April 2009 09:23

Brian Harry has posted a list of features that will be in the upcoming beta 1 of Visual Studio 2010 Team System. Unfortunately, the date of release for beta 1 has not been announced yet.

Architecture (http://blogs.msdn.com/camerons/)

  • Architecture Explorer
  • Layer diagram
  • Use case designer
  • Activity designer
  • Component diagram
  • Logical class designer
  • Sequence diagram
  • Modeling project system
  • UML Model explorer
  • Architecture validation during build

Development & Database (http://blogs.msdn.com/habibh/)

  • Historical debugging
  • Test impact analysis
  • Improved code analysis
  • Improved profiling (especially multi-tier)
  • Database extensibility

Lab Management (http://blogs.msdn.com/amit_chatterjee, http://blogs.msdn.com/lab_management)

  • Multi-tier Environment creation and management
  • Automated deployment
  • Easily manage machine pools
  • Network fencing
  • Checkpoints

Test (http://blogs.msdn.com/amit_chatterjee, http://blogs.msdn.com/james_whittaker)

  • Test planning
  • Test case management
  • Test prioritization
  • Run management & reporting
  • Project quality reports
  • Manual test execution
  • Diagnostic recording (environment, video, etc)
  • UI Automation recording
  • Coded UI tests

TFS (my blog http://blogs.msdn.com/bharry)

  • Work item hierarchy & linking
  • Improved Agile template
  • MOSS & WSS Dashboards
  • Simplified reporting
  • Improved support for parallel development
  • Rollback
  • Build queuing and pooling
  • Gated checkin
  • Simplified setup
  • Scale out of web and data tiers
  • Admin console
  • Project move/archive/restore
Bookmark and Share

Package Attribute Guid Confusion

by KodefuGuru 23. March 2009 16:50

One of the things that confused me about the attributes used to decorate a Visual Studio were the hardcoded guids in the examples. I didn't know where they came from or what I could use. In fact, I had the impression I had to generate my own guid for each definition like how you need to assign one for an editor factory.

It turns out that these are defined guids that you must use for certain activities. They're defined in Microsoft.VisualStudio.VSConstants as static readonly. Like String.Empty, this means you can't use them in an attribute decoration and is why you see string literals instead. Since I couldn't find a list of the actual guids, and I needed them, I wrote a quick console app to retrieve them from the VSConstants class. I then placed them in constant, string form in my own class. Here they are in case you need them as well.

internal class VSGuidStrings
{
    
public const string IID_IUnknown = "00000000-0000-0000-c000-000000000046";
    
public const string GUID_VSStandardCommandSet97 = "5efc7975-14bc-11cf-9b2b-00aa00573819";
    
public const string VSStd2K = "1496a755-94de-11d0-8c3f-00c04fc2aae2";
    
public const string GUID_VsUIHierarchyWindowCmds = "60481700-078b-11d1-aaf8-00a0c9055a90";
    
public const string CLSID_HtmDocData = "62c81794-a9ec-11d0-8198-00a0c91bbee3";
    
public const string CLSID_HtmedPackage = "1b437d20-f8fe-11d2-a6ae-00104bcc7269";
    
public const string CLSID_HtmlLanguageService = "58e975a0-f8fe-11d2-a6ae-00104bcc7269";
    
public const string GUID_HtmlEditorFactory = "c76d83f8-a489-11d0-8195-00a0c91bbee3";
    
public const string GUID_TextEditorFactory = "8b382828-6202-11d1-8870-0000f87579d2";
    
public const string GUID_HTMEDAllowExistingDocData = "5742d216-8071-4779-bf5f-a24d5f3142ba";
    
public const string CLSID_VsEnvironmentPackage = "da9fb551-c724-11d0-ae1f-00a0c90fffc3";
    
public const string GUID_VsNewProjectPseudoFolder = "dcf2a94a-45b0-11d1-adbf-00c04fb6be4c";
    
public const string CLSID_MiscellaneousFilesProject = "a2fe74e1-b743-11d0-ae1a-00a0c90fffc3";
    
public const string CLSID_SolutionItemsProject = "d1dcdb85-c5e8-11d2-bfca-00c04f990235";
    
public const string SID_SVsGeneralOutputWindowPane = "65482c72-defa-41b7-902c-11c091889c83";
    
public const string SID_SUIHostCommandDispatcher = "e69cd190-1276-11d1-9f64-00a0c911004f";
    
public const string CLSID_VsUIHierarchyWindow = "7d960b07-7af8-11d0-8e5e-00a0c911005a";
    
public const string GUID_DefaultEditor = "6ac5ef80-12bf-11d1-8e9b-00a0c911005a";
    
public const string GUID_ExternalEditor = "8137c9e8-35fe-4af2-87b0-de3c45f395fd";
    
public const string GUID_BuildOutputWindowPane = "1bd8a850-02d1-11d1-bee7-00a0c913d1f8";
    
public const string GUID_OutWindowDebugPane = "fc076020-078a-11d1-a7df-00a0c9110051";
    
public const string GUID_OutWindowGeneralPane = "3c24d581-5591-4884-a571-9fe89915cd64";
    
public const string BuildOrder = "2032b126-7c8d-48ad-8026-0e0348004fc0";
    
public const string BuildOutput = "1bd8a850-02d1-11d1-bee7-00a0c913d1f8";
    
public const string DebugOutput = "fc076020-078a-11d1-a7df-00a0c9110051";
    
public const string GUID_ItemType_PhysicalFile = "6bb5f8ee-4483-11d3-8bcf-00c04f8ec28c";
    
public const string GUID_ItemType_PhysicalFolder = "6bb5f8ef-4483-11d3-8bcf-00c04f8ec28c";
    
public const string GUID_ItemType_VirtualFolder = "6bb5f8f0-4483-11d3-8bcf-00c04f8ec28c";
    
public const string GUID_ItemType_SubProject = "ea6618e8-6e24-4528-94be-6889fe16485c";
    
public const string GUID_BrowseFilePage = "2483f435-673d-4fa3-8add-b51442f65349";
    
public const string guidCOMPLUSLibrary = "1ec72fd7-c820-4273-9a21-777a5c522e03";
    
public const string CLSID_ComPlusOnlyDebugEngine = "449ec4cc-30d2-4032-9256-ee18eb41b62b";
    
public const string GUID_VS_DEPTYPE_BUILD_PROJECT = "707d11b6-91ca-11d0-8a3e-00a0c91e2acd";
    
public const string GUID_ProjectDesignerEditor = "04b8ab82-a572-4fef-95ce-5222444b6b64";
    
public const string UICONTEXT_SolutionBuilding = "adfc4e60-0397-11d1-9f4e-00a0c911004f";
    
public const string UICONTEXT_Debugging = "adfc4e61-0397-11d1-9f4e-00a0c911004f";
    
public const string UICONTEXT_Dragging = "b706f393-2e5b-49e7-9e2e-b1825f639b63";
    
public const string UICONTEXT_FullScreenMode = "adfc4e62-0397-11d1-9f4e-00a0c911004f";
    
public const string UICONTEXT_DesignMode = "adfc4e63-0397-11d1-9f4e-00a0c911004f";
    
public const string UICONTEXT_NoSolution = "adfc4e64-0397-11d1-9f4e-00a0c911004f";
    
public const string UICONTEXT_SolutionExists = "f1536ef8-92ec-443c-9ed7-fdadf150da82";
    
public const string UICONTEXT_EmptySolution = "adfc4e65-0397-11d1-9f4e-00a0c911004f";
    
public const string UICONTEXT_SolutionHasSingleProject = "adfc4e66-0397-11d1-9f4e-00a0c911004f";
    
public const string UICONTEXT_SolutionHasMultipleProjects = "93694fa0-0397-11d1-9f4e-00a0c911004f";
    
public const string UICONTEXT_CodeWindow = "8fe2df1d-e0da-4ebe-9d5c-415d40e487b5";
    
public const string GUID_VsTaskListViewAll = "1880202e-fc20-11d2-8bb1-00c04f8ec28c";
    
public const string GUID_VsTaskListViewUserTasks = "1880202f-fc20-11d2-8bb1-00c04f8ec28c";
    
public const string GUID_VsTaskListViewShortcutTasks = "18802030-fc20-11d2-8bb1-00c04f8ec28c";
    
public const string GUID_VsTaskListViewHTMLTasks = "36ac1c0d-fe86-11d2-8bb1-00c04f8ec28c";
    
public const string GUID_VsTaskListViewCompilerTasks = "18802033-fc20-11d2-8bb1-00c04f8ec28c";
    
public const string GUID_VsTaskListViewCommentTasks = "18802034-fc20-11d2-8bb1-00c04f8ec28c";
    
public const string GUID_VsTaskListViewCurrentFileTasks = "18802035-fc20-11d2-8bb1-00c04f8ec28c";
    
public const string GUID_VsTaskListViewCheckedTasks = "18802036-fc20-11d2-8bb1-00c04f8ec28c";
    
public const string GUID_VsTaskListViewUncheckedTasks = "18802037-fc20-11d2-8bb1-00c04f8ec28c";
    
public const string CLSID_VsTaskList = "bc5955d5-aa0d-11d0-a8c5-00a0c921a4d2";
    
public const string CLSID_VsTaskListPackage = "4a9b7e50-aa16-11d0-a8c5-00a0c921a4d2";
    
public const string SID_SVsToolboxActiveXDataProvider = "35222106-bb44-11d0-8c46-00c04fc2aae2";
    
public const string CLSID_VsDocOutlinePackage = "21af45b0-ffa5-11d0-b63f-00a0c922e851";
    
public const string CLSID_VsCfgProviderEventsHelper = "99913f1f-1ee3-11d1-8a6e-00c04f682e21";
    
public const string GUID_COMPlusPage = "9a341d95-5a64-11d3-bff9-00c04f990235";
    
public const string GUID_COMClassicPage = "9a341d96-5a64-11d3-bff9-00c04f990235";
    
public const string GUID_SolutionPage = "9a341d97-5a64-11d3-bff9-00c04f990235";
    
public const string LOGVIEWID_Primary = "00000000-0000-0000-0000-000000000000";
    
public const string LOGVIEWID_Debugging = "7651a700-06e5-11d1-8ebd-00a0c90f26ea";
    
public const string LOGVIEWID_Code = "7651a701-06e5-11d1-8ebd-00a0c90f26ea";
    
public const string LOGVIEWID_Designer = "7651a702-06e5-11d1-8ebd-00a0c90f26ea";
    
public const string LOGVIEWID_TextView = "7651a703-06e5-11d1-8ebd-00a0c90f26ea";
    
public const string LOGVIEWID_UserChooseView = "7651a704-06e5-11d1-8ebd-00a0c90f26ea";
}

 

Bookmark and Share

Visual Studio Eats Exceptions

by KodefuGuru 20. March 2009 16:18

The managed package framework for Visual Studio eats exceptions. I discovered this while building my own editor.

I started with the package that the wizard creates for you, but I needed different designer rather than the rich text box it gives you. I initially attempted to gut the designer and implement my own functionality. However, it kept throwing a strange exception on me that I could not correct.

I reverted back to the designer that was there, then created a DecisionTablePane class and implemented the interfaces that I thought I would need: IOleCommandTarget, IVsWindowPane, IVsTextLinesEvents. I left the NotImplementedExceptions in place thinking that I could then see what was being called. I changed the editor factory to instantiate the new editor. This worked, and I will refactor later to remove the classes I no longer need; I'm keeping them around to use as a guide.

I tried to open the file type I had registered with the editor, but nothing happened. I thought that maybe I missed an interface, but I couldn't find anything. I then stuck a breakpoint on the method I suspected was being called, and it got there. The exceptions were being consumed without any error reporting. This will make it difficult to debug my Visual Studio package. If something doesn't work, I may not even know it.

Bookmark and Share

Reset Experimental Hive

by KodefuGuru 19. March 2009 14:52

When developing plugins for Visual Studio 2008, your testing is done in what's known as an experimental hive. It's essentially Visual Studio running in a testing environment. This keeps your unfinished plugins from being added to your "real" Visual Studio environment.

Unfortunately, this experimental hive tends to become junky. After going through tutorials, you're bound to have all kinds of unnecessary elements added to the IDE. I spent some time trying to clean this out, and I discovered that the Visual Studio 2008 SDK includes a tool to do this. However, its parameters weren't exactly clear and cause me some grief until I got it right.

Here are the commands that work for me:

"%ProgramFiles%\Microsoft Visual Studio 2008 SDK\VisualStudioIntegration\Tools\Bin\vsregex.exe" GetOrig 9.0 exp RANU
"%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe"  /setup /rootsuffix Exp /ranu

The first command clears out your experimental hive then copies your regular registry keys and user profile files over. After I did this, I found that all my templates were missing. The second command fixes that problem.

Bookmark and Share

Create Vista Icons in VS 2008

by KodefuGuru 8. August 2008 17:00

Axialis has released a free add-in for VS 2008 that creates the 256x256 icons used in Vista. Download IconWorkshop™ Lite and free yourself from the 32x32 bit tyranny!

 

 

Here's the download page:

http://www.axialis.com/download/iwlite.html

Bookmark and Share

Visual Studio 2008 and .NET Framework 3.5 Training Kit

by KodefuGuru 15. December 2007 18:38
By now you've attended an InstallFest and picked up a free copy of Visual Studio 2008 Pro, or perhaps you've just downloaded trial edition. Either way, it's time to get up to speed using the free Visual Studio 2008 and .NET Framework 3.5 Training Kit. It covers many of the new features in LINQ, C# 3.0, AJAX, WCF, WPF, and Silverlight.

KodefuGuru.GetInfo()

Chris Eargle
LinkedIn Twitter Technorati Facebook

Chris Eargle
C# MVP, INETA Community Champion


MVP - Visual C#

 

INETA Community Champions
Friend of RedGate
Telerik .NET Ninja
Community blogs & blog posts

I am a #52er

I have joined Anti-IF Campaign


World Map

Tag cloud

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010