Visual Studio integration of Ent Lib 5 config editor

Topics: Building and extending application blocks, General discussion
Jun 8, 2010 at 2:34 PM

We are distributing strong named assemblies of Enterprise Library 5 using our own WIX Installer.  What changes do we need to make to our developers' installation target system, so that the appropriate short cut to the Enterprise Library 5 Config Editor appears in the context menu (when a .config file in solution explorer is right clicked)?  We discovered that the context menu in VS2010 is smart and switches bassed upon target framework of a given project/assembly and invokes the appropriate executable.  VS2008 invoked the editor inside devenv.exe as a new tab, not a separate executable. 

What bearing does the OS 32 or 64 bit have on this logic/behavior?

EntLib Config .NET 4 (x86) : "C:\Program Files\Microsoft Enterprise Library 5.0\Bin\EntLibConfig.NET4-32.exe"

EntLib Config .NET 4 : "C:\Program Files\Microsoft Enterprise Library 5.0\Bin\EntLibConfig.NET4.exe"

EntLib Config .NET 3.5 (x86) : "C:\Program Files\Microsoft Enterprise Library 5.0\Bin\EntLibConfig-32.exe"

EntLib Config .NET 3.5 : "C:\Program Files\Microsoft Enterprise Library 5.0\Bin\EntLibConfig.exe"

Each project framework target affects the EntLibConfig version invoked.
How does VS2010 know "32" or "64?"?

Jun 9, 2010 at 6:51 AM

To make use of a different build of the config tool, you need to change some settings in the registry to refer to the location of the new assemblies.  Navigate to the HKEY_CURRENT_USER\Software\Microsoft\Practices\EnterpriseLibraryV5\ConfigurationEditor for per-user settings or to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\[version]\Packages\{ 88220936-600F-4815-8F00-E9EF22A31929 }\ConfigurationEditor for machine-wide settings.  Modify the value of the ConfigurationUIPluginDirectory key to the directory where the new version of the assemblies are located.  The value of the ConfigurationUIAssemblyPath should also likely to be modified to reflect the new directory.  This is included in the documentation, refer to this link for more info. (Look for the Specifying Different Assemblies topic).

"VS2008 invoked the editor inside devenv.exe as a new tab, not a separate executable. " - This is an expected behavior, see Chris Tavares' reply here.

As for your other question, I don't have the answer yet, will get back to you on that.

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Jun 15, 2010 at 7:35 PM
Edited Jun 15, 2010 at 7:36 PM

For last Friday, Monday and today I have tried everything provided in the links and made the appropriate registry updates. While it is possible to have the config app reference our assemblies, the VS IDE integration still is not working.

I keep getting this when it tries to load the integration package

Microsoft Visual Studio

Package Load Failure

Package 'Microsoft.Practices.EnterpriseLibrary.Configuration.Design.VisualStudioIntegration.EnterpriseLibraryIntegrationPackage, Microsoft.Practices.EnterpriseLibrary.Configurations.Design.VisualStudioIntegration' has failed to load properly ( GUID = {88220936-600F-4815-8F00-E9EF22A31929} ).  Please contact package vendor for assistance.  Application restart is recommended, due to possible environment corruption.  Would you like to disable loading this package in the future?  You may use 'devenv /resetskippkgs' to re-enable package loading.

Yes  No

Can you make a recommendation for some next steps to try to get this to work?

 

Jun 16, 2010 at 12:53 AM

Try running the following command in the Visual Studio Command Prompt:

Run devenv /ResetSkipPkgs
Run devenv /setup

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com

Jun 16, 2010 at 6:39 PM

We have attempted Visual Studio 2010 and Visual Studio 2008 IDE integration for our custom build of EntLib5. This was done by changing the following registry entries in our WiX installer that installs these custom EntLib5 assemblies.

We noticed that if we use the CodePlex version of the installer, the config editor launches as a separate application. But for our installer -- while the EntLib 5 Config Editor appears in the context menu when a .config file is right-clicked -- the editor launches in a "captive" tab inside VS2010 IDE (much like what happens in VS 2008). Is this a problem? Are there any additional registry settings that need to be changed?

 

       <RegistryKey Root="HKLM"

                     Key="Software\Microsoft\VisualStudio\10.0\InstalledProducts\EnterpriseLibraryIntegrationPackageV5"

                     Action="create">

         <RegistryValue Value="#110" Type="string"/>

         <RegistryValue Name="Package" Value="{88220936-600f-4815-8f00-e9ef22a31929}" Type="string" />

         <RegistryValue Name="ProductDetails" Value="#112" Type="string" />

         <RegistryValue Name="PID" Value="4.0" Type="string" />

         <RegistryValue Name="LogoID" Value="#400" Type="string" />

       </RegistryKey>

 

       <RegistryKey Root="HKLM"

                     Key="Software\Microsoft\VisualStudio\10.0\Packages\{88220936-600f-4815-8f00-e9ef22a31929}"

                     Action="create">

         <RegistryValue

           Value="Microsoft.Practices.EnterpriseLibrary.Configuration.Design.VisualStudioIntegration.EnterpriseLibraryIntegrationPackage, Microsoft.Practices.EnterpriseLibrary.Configuration.Design.VisualStudioIntegration"

           Type="string"/>

         <RegistryValue Name="InprocServer32" Value="[SystemFolder]mscoree.dll" Type="string" />

         <RegistryValue Name="Class" Value="Microsoft.Practices.EnterpriseLibrary.Configuration.Design.VisualStudioIntegration.EnterpriseLibraryIntegrationPackage" Type="string" />

         <RegistryValue Name="CodeBase" Value="[BINLOCATION]Microsoft.Practices.EnterpriseLibrary.Configuration.Design.VisualStudioIntegration.dll" Type="string" />

         <RegistryValue Name="ID" Value="1" Type="integer" />

         <RegistryValue Name="MinEdition" Value="Standard" Type="string" />

         <RegistryValue Name="ProductVersion" Value="5.0.0.0" Type="string" />

         <RegistryValue Name="ProductName" Value="Enterprise Library Configuration Editor" Type="string" />

         <RegistryValue Name="CompanyName" Value="Microsoft" Type="string" />

       </RegistryKey>

 

       <RegistryKey Root="HKLM"

                     Key="Software\Microsoft\VisualStudio\10.0\AutoLoadPackages\{f1536ef8-92ec-443c-9ed7-fdadf150da82}"

                     Action="create">

         <RegistryValue Name="{88220936-600f-4815-8f00-e9ef22a31929}" Value="0" Type="integer"/>

       </RegistryKey>

 

       <RegistryKey Root="HKLM"

                 Key="Software\Microsoft\VisualStudio\10.0\Editors\{b664d5bf-b647-422a-ad19-d73b92490e5f}"

                 Action="create">

         <RegistryValue Value="EnterpriseLibraryIntegrationPackage" Type="string"/>

         <RegistryValue Name="DisplayName" Value="#105" Type="string" />

         <RegistryValue Name="Package" Value="{88220936-600f-4815-8f00-e9ef22a31929}" Type="string" />

       </RegistryKey>

 

       <RegistryKey Root="HKLM"

                 Key="Software\Microsoft\VisualStudio\10.0\Editors\{b664d5bf-b647-422a-ad19-d73b92490e5f}\Extensions"

                 Action="create">

         <RegistryValue Name="config" Value="31" Type="integer" />

       </RegistryKey>

 

       <RegistryKey Root="HKLM"

                 Key="Software\Microsoft\VisualStudio\10.0\Editors\{b664d5bf-b647-422a-ad19-d73b92490e5f}\LogicalViews"

                 Action="create">

         <RegistryValue Name="{7651a703-06e5-11d1-8ebd-00a0c90f2e6c}" Value="" Type="string"/>

       </RegistryKey>

 

       <RegistryKey Root="HKLM"

                 Key="Software\Microsoft\VisualStudio\10.0\Menus"

                 Action="create">

         <RegistryValue Name="{88220936-600f-4815-8f00-e9ef22a31929}" Value=", 1000, 1" Type="string" />

       </RegistryKey>

 

 

And then

 

       <RegistryKey Root="HKLM"

                     Key="SOFTWARE\Microsoft\VisualStudio\10.0\Packages\{88220936-600f-4815-8f00-e9ef22a31929}\ConfigurationEditor"

                     Action="create">

         <RegistryValue Name="defaultConfigurationSet" Value="MyCompany Signed" Type="string"/>

       </RegistryKey>

       <RegistryKey Root="HKLM"

                     Key="SOFTWARE\Microsoft\VisualStudio\10.0\Packages\{88220936-600f-4815-8f00-e9ef22a31929}\ConfigurationEditor\MyCompany Signed"

                     Action="create">

         <RegistryValue Name="ConfigurationUIAssemblyPath" Value="[BINLOCATION]Microsoft.Practices.EnterpriseLibrary.Configuration.DesignTime.dll" Type="string" />

         <RegistryValue Name="ConfigurationUIAdapterClass" Value="Microsoft.Practices.EnterpriseLibrary.Configuration.Design.Hosting.SingleHierarchyConfigurationUIHostAdapter" Type="string" />

         <RegistryValue Name="ConfigurationUIPluginDirectory" Value="[BINLOCATION]" Type="string" />

       </RegistryKey>

Jun 17, 2010 at 6:43 AM

We decided on the separate process launch in VS 2010 for two reasons. The first, and simplest one, was simply the amount of test effort involved. With a fully integrated editor, we'd have to basically retest the entire config tool. With the launcher, we just needed to test the launch, since we've already tested the config tool itself.

The second, and more important reason, was due to VS multitargeting and type selection. Here's the issue - VS 2010 is a 32-bit, .NET 4.0 application. However, it lets you target .NET 2.0, 3.0, 3.5, or 4.0, and either 32 or 64 bit assemblies. However, with the integrated you will ONLY ever get the tool running in 32-bit, .NET 4.0. Which completely screws you up if you're working on a 64-bit .NET 3.5 application; it'll reference the wrong CLR, and the wrong bitness, and everything blows up. Since VS addins run in-process, you're stuck.

This problem occurred in VS 2008 as well, but it was made much more apparent by the change to explicitly make client apps (winforms, wpf) in VS 2010 32 bit. Run it on a 64-bit machine and you'll end up with bitness mismatches all over the place. Basically it was a mess. The separate launcher can detect which flavor of project you're building, and running in a separate .exe is the only way to get the correct bitness and version of the CLR.

The only reason VS 2008 is still running with the integrated tool is that the code was already done. If we'd had time we'd have backed down to the external launcher as well. The code is SOOO much smaller, simpler, and more robust, and the user experience doesn't seem to suffer any. Heck, this approach was good enough for WCF, it should be good enough for us. :-)

It looks like for your installer you just copied the registry entries for VS 2008 and moved them to the VS 2010 registry hive. If it works, good for you, but we've never tested that configuration so no promises it doesn't delete your hard drive. The registry settings for the VS 2010 integration are different; I'll see if I can dig up the source to the installer for that section and send it on.

 

Jun 28, 2010 at 5:29 PM
Thank you sir. Please find the VS 2010 registry hive and settings. Our users are faced with a pop up error message because of this. I have to explain it to them and it feels awkward. We would love to get it working more smoothly. Just to review: We have the VS2010 32 bit invoking the Ent Lib Config tool, but it is coming up inside VS 2010 instead of separate, and we are getting an error message: Microsoft Visual Studio The 'Microsoft.Practices.EnterpriseLibrary.Configuration.Design.VisualStudioIntegration2010.VisualStudioIntegration2010Package, Microsoft.Practices.EnterpriseLibrary.Configuration.Design.VisualStudioIntegration2010, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' package did not load correctly. The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by running the application together with the /log parameter on the command line, and then examining the file 'C:Dcouments and Settings\[userid]\ApplicationData\Microsoft\VisualStudio\10.0\ActivityLog.xml'. Continue to show this error message" Yes No Can you help us? Sincerely, Joe
Aug 30, 2011 at 6:12 PM
Edited Aug 30, 2011 at 6:13 PM
JoeKahl wrote:
Thank you sir. Please find the VS 2010 registry hive and settings. Our users are faced with a pop up error message because of this. I have to explain it to them and it feels awkward. We would love to get it working more smoothly. Just to review: We have the VS2010 32 bit invoking the Ent Lib Config tool, but it is coming up inside VS 2010 instead of separate, and we are getting an error message: Microsoft Visual Studio The 'Microsoft.Practices.EnterpriseLibrary.Configuration.Design.VisualStudioIntegration2010.VisualStudioIntegration2010Package, Microsoft.Practices.EnterpriseLibrary.Configuration.Design.VisualStudioIntegration2010, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' package did not load correctly. The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by running the application together with the /log parameter on the command line, and then examining the file 'C:Dcouments and Settings\[userid]\ApplicationData\Microsoft\VisualStudio\10.0\ActivityLog.xml'. Continue to show this error message" Yes No Can you help us? Sincerely, Joe


Hi Joe

It will be great if you can share the solution to above problem. I also received the same error as below

{ ---------------------------
Microsoft SQL Server Management Studio
---------------------------
The 'Microsoft.Practices.EnterpriseLibrary.Configuration.Design.VisualStudioIntegration2010.VisualStudioIntegration2010Package, Microsoft.Practices.EnterpriseLibrary.Configuration.Design.VisualStudioIntegration2010, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' package did not load correctly.

The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by running the application together with the /log parameter on the command line, and then examining the file 'C:\Users\[userid]\AppData\Roaming\Microsoft\AppEnv\10.0\ActivityLog.xml'. 

Continue to show this error message?}

Sep 14, 2012 at 10:14 AM

I still see this issue with sql 2012 RTM. Is there any way to fix it?