Deployment - *Registry.wxs problem

Topics: Service Factory Modeling Edition Forum
Jul 4, 2008 at 12:10 PM
Edited Jul 4, 2008 at 2:22 PM
Hi there,

We have a strange problem with deployment.
We have requested the PLK's as required and installed them into the solution, after that I have tested that it worked on my developer machine with the /NoVSIP switch set, no problem at all. Even tried putting in bogus values in the ProductName and instantly VS2005 refuses to load the package.

Then we decided to try it out a clean virtual machine via the generated installer. Visual loaded the package with no problem what so ever, BUT when I then tried to double click one of the model files all hell broke loose with VS refusing to load the DatacontractDSL, HostDesignerDSL and ServiceContractDSL.
I then tried starting VS2005 with the /log switch thrown, and true enough the activity log shows that it couldnt load the 3 projects because of invalid load keys.

A bit puzzled I checked my developer machines registry and saw that everything was fine and the keys(CompanyName, ProductName, MinVersion, ID ...) needed to validate the PLK were set correctly, and true enough everything works on that machine.
Now on the Virtual machine where we installed it via MSI these keys are missing???

After digging around for a while I found the DataContractRegistry.wxs file and matching T4 template and true enough the keys were not present in the file. After doing a history on the files in the repository I found that they used to be there but after usen the "transform all templates" they simply aren't there anymore.

Does anybody else have had this problem?

The keys not getting regenerated in DataContractRegistry.wxs are :
                <Registry Root='HKLM' Key='Software\Microsoft\VisualStudio\8.0\Packages\{1a168a56-ee16-4520-a071-3431a82d3e1f}' Id='g40f3b2bb_e74a_4a3d_992d_44742cf41a53' Name='ID' Value='1' Type='integer' />
                <Registry Root='HKLM' Key='Software\Microsoft\VisualStudio\8.0\Packages\{1a168a56-ee16-4520-a071-3431a82d3e1f}' Id='gafc72948_527b_e235_91dd_d63f484ab969' Name='MinEdition' Value='Standard' Type='string' />
                <Registry Root='HKLM' Key='Software\Microsoft\VisualStudio\8.0\Packages\{1a168a56-ee16-4520-a071-3431a82d3e1f}' Id='g3db82f7e_26f9_8d33_adf8_a1db4c418d11' Name='ProductVersion' Value='' Type='string' />
                <Registry Root='HKLM' Key='Software\Microsoft\VisualStudio\8.0\Packages\{1a168a56-ee16-4520-a071-3431a82d3e1f}' Id='g88d60c92_f679_cd3c_8f91_af56d9ec897c' Name='ProductName' Value='Service Factory: Data Contract Model' Type='string' />
                <Registry Root='HKLM' Key='Software\Microsoft\VisualStudio\8.0\Packages\{1a168a56-ee16-4520-a071-3431a82d3e1f}' Id='g169ad856_cb59_ce31_b1d7_a3996ee93d97' Name='CompanyName' Value='Microsoft Corporation' Type='string' />

After checking the T4 template I can see that there are calls to "this.GenerateRegistryWix", I have been looking for this method via the reflector but cant seem to locate it, google returns 1 hit which is never a good sign :)
Does anyone know where it is defined?
Or have had similar experiences?

Or am I missing a point here?
Jul 10, 2008 at 4:45 PM
Edited Jul 10, 2008 at 4:45 PM

Hi Klavs,


The GenerateRegistryWix is part of the DSL tools either injected as a DirectiveProcessor or as part of the Host itself.   


Make sure you properly generated the wxs for the Dsl registration. If so, then perhaps the Dsl may not have the right stuff embedded in its ProvideLoadKeyEntry. 
Check these steps to verify you have everything generated:

1.       The PLK needs to be setup in the DSLs on the model surface, then re-generat the tt’s so that the right constants show up in the DSL Package Constants.cs file.

2.       They should check the ProvideLoadKey entry on the GeneratedCode\Package.cs to make sure the entry is there and maps to the correct Constatns.cs.

3.       After the DSL and DSLPackage assemblies are recompiled, the will need to be regenerated.  This should then cause these entries to appear in the DataContractRegistry.wxs file.


Note: For the PLK’s to work all the information used to register the PLK needs to match exactly to what is registered by the DSL’s ProvideLoadKey entry.

Thanks to brumfb ( on providing an insight on this issue. 



Jul 14, 2008 at 9:59 AM
Hi Charly, and thanks for the reply.

1. I guess that you mean that the CompanyName, PackageGuid and so forth should be set up on the model surface it self, while the PLK should be entered into the *.resx file in the package project. And yes the right constants are entered into the constants file. IF there is a way to enter the PLK directly on the model surface I would love to know how to do this.

2. Yes thats setup correctly with the ProvideLoadKey attribute pointing to the right constants file with the correct values, and pointing to the *.resx file where the PLK is entered.

3. Nope thats the problem.

The PLK's are the correct ones with the right infomation, if I copy paste the infomation directly into the registry the packages will load no with problem.

We followed the article "Building a custom installer for the service factory : modeling edition".

Anyway Im on vacation now so I'll dig into it again when Im back at work :)

I'll post any findings.

Thanks again, and have a nice day!
Jul 24, 2008 at 7:17 AM

Hi Klavs,
            I am facing the same Problem. Did you got any solution..., can you tell me which values need to be replace in .wsx file with newly generated PLK for DataCoontract.
Can you please go through with my problem, posted at



Jul 28, 2008 at 1:55 PM
Got it to work somehow. No idea what happened.

After getting stuck I sat down with another developer and quite by coincidence, I decided to only transform a single template by running "run custom tool" instead of "transform templates" on DataContractRegistry.wxs. Guess what?  it worked!
After transforming all the wix files this way I compiled and installed the new versions and it runs. The funny thing was then I figured I would try to use the "transform all templates" to see it fail, but nope, still works.
I just checkout the version that we were fighting with before I went on vacation and did exactly the same thing as three weeks ago and it still works. I have just diffed the files in the repository and there are no changes on the model files or any of the files used with the PLK'S, other than that there are a few minor changes to custom actions like renaming of local vars and clean up like that.

I am clueless unless it should be a cache problem of some sort, but we lost enough time on it already so I think I'll let this one be the one that got away.

Thanks for the time Charly!
Jul 30, 2008 at 5:35 PM
Is it possible that the target .wxs file was read-only? There was a bug with Transform Text Templates where it would quietly skip transformations whose output would have needed to overwrite a read-only file. I saw this with files checked into source control. This particular problem seems to have been fixed in the SP1 beta.
Jul 31, 2008 at 6:46 AM
Hi John,

No I dont believe so. And on the other hand why would it then replace/re-transform everything in the file except the 4 lines needed in for the registry?
If it was read only should it either transform all the content or none at all?