Help needed on VS2008 integration.

Topics: Enterprise Library Core, General discussion
Aug 11, 2008 at 8:48 PM
I need to understand how Configuration Console integrates with VS2008. Do we have a VSPackage code for EntLib 4.0 ? Any directions on this will be highly helpful.
Thanks in advance.
Aug 11, 2008 at 9:59 PM
Hi Neo,

The source code for the VS Package that implements the configuration editor is not shipped. However, you are of course free to use Reflector to look at the types.

What is exactly what you want to learn about the tool? Is it how this specific package works (which is tricky given the need to support different sets of binaries) or how packages and editors work in general?

Aug 12, 2008 at 6:04 PM
Edited Aug 12, 2008 at 8:58 PM
I need it for multiple reasons.

1. We have customized the Config Console, and deploy EntLib Dlls in our own custom installer. So the built in VSPackage that comes with Entlib installer msi doesnt get involved.
2.  We have decided to stay with EntLib3.1, but on VS2008 already, so have to get our custom config console integrated with VS2008

So the answer to your question is, I need to know both, how the VSPackge for EntLib4.0 works and also packages and editors in general. I am facing a real steep learning curve with VSpackages.It will helpful if i get to know, how the EntLib4.0 VSPackage is implemented.


Aug 12, 2008 at 7:21 PM
Hi Neo,

You shouldn't need to update the package itself to use an updated tool, but you will need to perform some surgery in EntLib's source code to make it work. The package is really just a viewpoint for a configuration tool, interacting with it though the narrow Microsoft.Practices.EnterpriseLibrary.Configuration.Design.HostAdapter.ISingleHierarchyConfigurationUIHostAdapter interface; you can find its assembly in EntLib's install folder.

In order to pull this off, you'll need to build new versions of the design time assemblies referencing the EntLib v4.0 version of the Microsoft.Practices.EnterpriseLibrary.Configuration.Design.HostAdapter assembly, copy all binaries to a folder (both the original binaries for the runtime and the new design time binaries you built - the "build library and copy assemblies would do", if you also want to rebuild the runtime binaries), and define a new configuration set for this folder as described in Tom's post.

For VSX specific questions you can try

Aug 12, 2008 at 9:13 PM
Edited Aug 13, 2008 at 12:24 AM
I do already have new versions of design time dlls, to accommodate the customization i was talking about. So that shouldnt be a problem. Moreover  only Configuration.Design.UI (and so Configuration.Console) will need a recompilie, as it is the only project referenceing the HostAdapter dll. We do deploy the new design times and original runtime binaries in the common folder, so thats not a problem either.But I cannot create a new configuration set for my situation, as we dont use EntLib installer to deploy on our end machines, so I think  I have to make my own VSPackage ?

Thanks for your replies, I will see if i can get any help on the VSX forum.
Aug 12, 2008 at 10:25 PM
What do you mean you cannot create a new configuration set?

I don't think you need to create a new package, but of course you can do it if you want. Regardless of whether you use the existing package or a new one you create, you will still need to install it in the dev machines; you can create your custom installer to install EntLib's package if using EntLib's is not an option. Of course, this requires a whole new set of skills (which arguably are hidden to some extent if you rely on the tooling provided to create new packages.)


Aug 13, 2008 at 12:33 AM
What i was referring to, is. without using Entlib installer, i will not be able to get the EntLib package installed on dev machines. Isnt that right ? 
..."you can create your custom installer to install EntLib's package if using EntLib's is not an option.". Iam not sure how i can get hold of EntLibs Package, i thought the code is not shipped with EntLib download. But yes, i agree, that i will be installing the package on dev machine regardless if its new or old. I just dont see how i can reuse the EntLib Package, when i dont have access to it.

And hence, my approach was to create one, and  have my custom installer install it on dev machines. May be I am missing something here..because of my lack of experience in VSPackage and its deployment.
Aug 13, 2008 at 2:21 AM
EntLib's package is just an assembly that follows some conventions and a few entries in the registry. You already have the binary, so if you manage to recreate the entries in the registry you're good. This is what the regpkg.exe tool, available with the VS SDK, does for you among other things. You could use regpkg on the shipped assembly to create a wix fragment to help you create an installer, or generate a .reg file that you can use to install the package manually of using a script (not that this is recommended, but it is possible.)

When you create a new package and an installer for it, you're really doing two separate steps even though the tooling may blur the boundary. That's why I say you don't need to create a new package, you can skip the step of writing the code and build an assembly and just do the installer part. You may want to create a new plain-vanilla package to see how pieces fit together, but other than that I don't see a compelling reason for writing your own editor package from scratch.