VSSDK Assist - Generated VSPackage project doesn't compile

Topics: General Discussion Forum
Dec 3, 2007 at 12:45 PM
Pablo,

I guess you'll be able to reproduce by following the steps below:

1. Create a brand new VS Shell Isolated Mode solution in VS 2008 and build it.
2. Right-click the solution and select Add... | New project
3. Add a Guidance Packages | VSSDK Assist | Visual Studio Package (CSharp)
4. Accept all defaults and try to compile.

I get the following error/Warning messages:

- Warning 1 Load of property 'RootNamespace' failed. The string for the root namespace must be a valid identifier. MyVsPackage

I looked at the Properties of MyVsPackage and teh Default Namespace is MyVsPackage. So it's valid, ok?

- Error 2 Failed to retrieve paths under VSTemplate for the specified registry hive. MyVsPackage

I suspect there's a problem with
DefaultRegistryRoot("Software\\Microsoft\\VisualStudio\\9.0")
in the generated VsPackage.cs. However, I'm not sure about what registry root should be specified here since it's a VS Shell Isolated Mode solution.

- Warning 3 The custom tool 'ResXFileCodeGenerator' failed while processing the file 'Properties\Resources.resx'.

???

Cheers.

--
Patrick
Coordinator
Dec 3, 2007 at 2:32 PM
Patrick,

Those compile warnings that you see are part of the unfolding process. They are normal behavior and just warnings.

For the "- Error 2 Failed to retrieve paths under VSTemplate for the specified registry hive. MyVsPackage", could you provide more details on this?

To integrate a VS Package with a VS Shell app, you need to generate a pkgdef file. An the registry root used is : HKLM\Software\Microsoft\AppEnv\9.0\Apps\YOUR_VSSHELL

Pablo
Dec 3, 2007 at 2:39 PM

To integrate a VS Package with a VS Shell app, you need to generate a pkgdef file. An the registry root used is : HKLM\Software\Microsoft\AppEnv\9.0\Apps\YOUR_VSSHELL

I thought this was done automatically. I'll try and let you know.

--
Patrick
Coordinator
Dec 3, 2007 at 2:52 PM
Yes, it is created automatically.
Dec 4, 2007 at 9:18 AM
Edited Dec 4, 2007 at 9:19 AM
Hi Pablo,

For the "- Error 2 Failed to retrieve paths under VSTemplate for the specified registry hive. MyVsPackage", could you provide more details on this?

Well, I need details :-)) . In the test package code generated by VSSDK Assist, VsPackage.cs has the following attribute by default (that is, VSSDK Assist doesn't know/detect that teh package belongs to a VS Shell Isolated Mode solution.

DefaultRegistryRoot("Software\\Microsoft\\VisualStudio\\9.0")

I replaced it with

DefaultRegistryRoot("SOFTWARE\\Microsoft\\AppEnv\\9.0\\Apps\\TestShell_5678bb36-7c85-45f6-842a-5ef6973b6ecb")

This didn't fix error #2. I also tried to enable the TargetRegistryRoot tag in the VSPackage project file:

<!--
To specify a different registry root to register your package, uncomment the TargetRegistryRoot
tag and specify a registry root in it.
-->
<TargetRegistryRoot>SOFTWARE\Microsoft\AppEnv\9.0\Apps\TestShell_5678bb36-7c85-45f6-842a-5ef6973b6ecb</TargetRegistryRoot>

Didn't help either. Next, I used RegMon to determine where VS was looking for the registry key: bingo! In HKCU, not in HKLM.

Well, I don't understand: the VSTemplate key is under HKLM\SOFTWARE\Microsoft\AppEnv\9.0\Apps\TestShell_5678bb36-7c85-45f6-842a-5ef6973b6ecb, not in HKCU.

Cheers.

--
Patrick
Coordinator
Dec 4, 2007 at 1:29 PM
Patrick,

Let's start from the begining. :)
You don't need to change the DefaultRegistryRoot attribute. This is only applicable for VS Packages.
If you need to integrate a VS Package with a VS Shell Isolated application you can read my post about that:
http://www.clariusconsulting.net/blogs/pga/archive/2007/11/22/IntegratingaVSPackagewithaVSShellapplication.aspx
Also you can download the Storyboard designer, that is a working sample of a VS Shell Isolated application:
http://www.codeplex.com/storyboarddesigner
To register a VS Package and integrate it with a VS Shell App, you need to place the pkgdeffile generated when you compile the VS Package project into the PackagesToLoad directory.
Then when you do VSShellApp.exe /Setup, the registry entries are added automatically to the corresponding hive. (SOFTWARE\Microsoft\AppEnv\9.0\Apps\YOUR_APP)
Take a look at this post, regarding the registry:
http://www.clariusconsulting.net/blogs/pga/archive/2007/11/22/VSShellandtheregistry.aspx

Hope this helps,
Pablo
Dec 4, 2007 at 3:01 PM
Edited Dec 4, 2007 at 3:07 PM
Pablo,

If you need to integrate a VS Package with a VS Shell Isolated application you can read my post about that:
http://www.clariusconsulting.net/blogs/pga/archive/2007/11/22/IntegratingaVSPackagewithaVSShellapplication.aspx


This is exactly what I did.

Also you can download the Storyboard designer, that is a working sample of a VS Shell Isolated application:
http://www.codeplex.com/storyboarddesigner

I'll have a look.

To register a VS Package and integrate it with a VS Shell App, you need to place the pkgdeffile generated when you compile the VS Package project into the PackagesToLoad directory.

Did this.

Then when you do VSShellApp.exe /Setup, the registry entries are added automatically to the corresponding hive. (SOFTWARE\Microsoft\AppEnv\9.0\Apps\YOUR_APP)

Correct.

Take a look at this post, regarding the registry:
http://www.clariusconsulting.net/blogs/pga/archive/2007/11/22/VSShellandtheregistry.aspx

I read this. So apparently, the generated code and the generated registry information are correct. The problem however, is that when compiling the solution, VS looks for the VSTemplate subkey in **HKCU**\SOFTWARE\Microsoft\AppEnv\9.0\Apps\TestShell_5678bb36-7c85-45f6-842a-5ef6973b6ecb\**Configuration**\VSTemplate. That's the problem.

I have started a thread abour this:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2501751&SiteID=1&mode=1

Cheers.

--
Patrick