index > Visual Studio Guidance Automation Toolkit > Loosing Item Template Information

Loosing Item Template Information

Hi,

I just had the following weird behaviour: I startet with my first sample solution (first steps in GAT) and tried to follow the Item template logic. I played a bit and made obviously one or the other mistake. Eventually (the GAT solution was OK by then) the Item templates (provided by the GAT solution and until then available in the test solution, context menu "Add") were gone. De/registering, rebuilding, and un/loading didn't help.

The weird part:

  • the context menu showed no item templates (beyond the VS standard)
  • In guidance package manager/enable packages two of the original six item templates reappeared
  • In guidance package manager/enable packages/explore selected package all templates were shown (come to think of it: my own test template may have been the third one in this list)

But it gets better: I finally tried to create a fresh GAT solution to get a working version and to look for the differences. Using this new version I also created a new test solution. It worked. But then I tried to open the old test solution and I got some error messages about unknown properties. Which finally lead me to the realization that the GuidancePackage1Solution1.gpState file is crucial for the GAT package to work. Delete it and the item templates disappear, copy a save file back and the templates are back as well.

Now, *.gpState files are AFAIK used by the installer to keep track of information to be used for uninstall. It seems that the GAT package installer is run with every opening of the test solution (not just during register). And since the file is allways written back, any error in the GAT package will cause this information to be lost forever.

Questions for MS:

  1. are my observations correct?
  2. can I recreate this information without creating a new GAT solution every time?
  3. Is this going to change?

Regards,
Alexander




Alexander
Alexander Jung

Hi Alexander,

The .gpState file is not used at all for installing. This file contains the information for which guidance packages are binded to the solution and some state like references state is stored there. What may have hit you is that bound references are lost when you re-enable a package (by your description I guess you used a TemplateReference to get your item template to show). This is one of the reasons why unbound references are much preferred today over bound ones.

Another thing you should keep in mind, is that there is a known bug when .gpState is under source control, you need to make sure it is writable (by setting its readonly flag to off or by checking out the file) before closing the solution you're working with.

HTH,
-Victor.

vga

Hi Victor,

thanks for the reply.

I understand the concept of bound and unbound references, yet I haven't been exploring the sample solution in such detail. And the documentation (yes, I found it ;-) states that it contains quite a bit more information, e.g. initial state of unbound references, and about the various packages used by the solution. So the .gpState is even shared among all packages, meaning that one misbehaving package will affect all other packages as well?!

Anyway, this only explains the cause, not the diagnosis or the cure.

Diagnosis: If my templates are gone, how can I find the root cause? Since my template was the third in line and in guidance package manager/enable packages I (think I) saw two items I can only guess there was a problem with my template. However I didn't get any form of warning (not in the output, nor in DbgView). How should I know (especially in a project on which more people are working simultaniously) which file is the culprit? Is there a way to check the validity of the package or perhaps to enable more detailed feedback during registration?

Cure: Once I have tracked the problem down I still face the problem that my .gpState is lost. Will it be recreated if I solved the problem? If not, how do I bind the references again (not to mention the other information in the .gpState)?

And as an add-on question: A collegue just had a similar problem with a solution template. Where is this information stored (since there is not yet a solution)?

Regards,
Alexander




Alexander
Alexander Jung
reply 3

You can use google to search for other answers

 

More Articles

• Another installation error
• Not able to create a new Guidance Package project
• GAT not compatible with W2K?
• enable/disable - wizard navigation buttons
• Help with an error message
• Synchronizing - GAT Package Changes
• Visual Studio hangs when I install the T4Editor!!
• Cannot download June CTP GAX or GAT - download hangs
• Custom Wizards and custom arguments
• Solution Folder Name
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• Build Event programatically - set post b
• Guidance Automation Extensions Registrat
• Guidance Package Visual Studio 2005 Proj
• Is GAT/GAX compatible with non-English v
• Minor bug in VszWizard.FindAddItem
• How do you add a using/reference to a t4
• VSTS - Web Test - FIND TEXT command
• make wizard check in file after automate
• Upgrading Headaches
• T4 templates editor?
• Update guidance already installed
• Is there a way to use the T3 engine as a
• No assemblies placed in GAC
• UIPAB
• Generic argument types

Hot Articles

• How to create a database project with te
• Alter Name of Solution
• Reality Check?
• GAT Problem
• Can't run the Guidance Package
• Not able to create a new Guidance Packag
• configured attribute T3 - no property o
• Declaratively determining if an action r
• Loading solution verty slow
• Error install GAX
• How to Create Project Reference and App_
• CAB Module menu item doesn't run
• Another installation error
• Project References Guids?
• How can you use T3 templates in VS templ

Recommend Articles

• How does one set a default value?
• Project reference problem
• GuidancePackage Solution Will Not build
• warnings when I try to create guidance p
• Error installing GAX
• Cant' install "Guidance Automation
• Reality Check?
• Get all classes from a Project?
• Alter Name of Solution
• How to execute actions after solution te
• Tom, I see what has been keeping you bus
• IExtenderProvider the GAT way...
• Error "System.ArgumentNullException
• Set version for Guidance Package
• Simulate DependentUpon with DTE class