Feed Subscribe
Exception has been thrown by the target of an invocation.


"String cannot have zero length" when you try to install a .vsi file

by ondrejsv 21. December 2007 14:28

Today I decided to have a look at the recently released Visual Studio 2008 and .NET Framework 3.5 Training Kit which contains several presentations, labs and samples. I opened the first demo (about LINQ but it's not important right now), read the supplied instructions and run setup.bat. This small batch file does some nifty work, including running LINQ.vsi full of code snippets. But I ended here because a message box reading "String cannot have zero length" popped out at me. Fortunately I wasn't the first one having this issue and I found a forum topic on the asp.net site where Frank Tse (member of the ASP.NET team) explains that some missing Registry keys may be cause of this problem:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSEnvCommunityContent\ContentTypes\VSTemplate]
"ClassName"="VSContentInstaller.VSTemplateInstallerPage"
"DisplayName"="#VSTemplateContentDisplayName"

Although my Registry missed them too, unfortunately adding them didn't help me. As the .vsi file I tried to install contains just code snippets, I checked also the Code Snippet key in the same subtree and indeed, there were no ClassName and DisplayName values so I asked one of my colleagues to look for them in his computer. They are:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSEnvCommunityContent\ContentTypes\Code Snippet]
"ClassName"="VSContentInstaller.SnippetInstallerPage"
"DisplayName"="#CodeSnippetsContentDisplayName"

After inserting them I completed the installation successfully. :-)

Tags:

Comments are closed