Thursday, December 21, 2006

RECOVERING VISUAL C# EXPRESS' PROJECT TEMPLATES

After installing XNA GSE v1 I happened to find that the project templates that come by default with the express version of VS C# - that is, Windows Application, Class Library, Console Application, etc. - had vanished from the IDE's templates browser ... :(

My first desperate move was uninstalling and reinstalling the whole thing (of course, after a very laoud scream of terror), but before jumping to a pool where maybe there was no water at all, I though (and look how clever I am): "Weeelllll! Maybe it's time to watch some TV ...", but adding almost instantly: "... but first let's do some search on MS's forums so as to get some answers, put the blame on someone else and common daily things like that ...".

For my surprise I found not one but two threads related to a similar issue which gave me a relevant hint on the workaround. And as we are approaching Christams Eve I'm going to share with all of you ...

The solution is simple, just execute the following line -either through the command shell (cmd.exe) or browsing your windows explorer to "start > run":

"%vs80comntools%\..\..\common7\ide\vcsexpress.exe" /installvstemplates

Of course you'll have replace "%vs80comntools%\..\..\common7\ide\vcsexpress.exe" with the correct path to "vcexpress.exe" in your local machine.

Although it all should work, it may occur a catch: the templates might still be missing according to the IDE's templates browser (this happened in my case, meaning, another scary scream). No sweat! If you open the folder where "vcexpress.exe" is located you will also find a folder named "VCSExpress", right?

If you don't, contact your local administrator, who will recommend you to (un/re)install everything.

If you did, open "ProjectTemplates" folder and then "1033" folder so as to find at least 4 zip files (usually 6) containing the missing templates. Copy these zip files to "ProjectTemplates", run again the above-mentioned command line and voilá! The IDE now recognizes all of the installed project templates.

It seems that XNA GSE installation process changes the "cache" file located in a folder named "ProjectTemplatesCache" in a way that all of the project templates installed within the "ProjectTemplatesCache\1033" folder are disregarded.

Thus, after applying the workaround commented in this article you will find the recovered templates duplicated in the "ProjectTemplatesCache" folder (that is, 6 inside and 6 outside the "1033" folder) until a MS's team fixes future installers of upcoming XNA GSE versions ... ;)

See ya!

No comments:

Post a Comment

Any thoughts? Post them here ...