HOL WCF Exercise 11 Problems

Topics: General Discussion Forum, July and December Releases Forum
Apr 24, 2007 at 6:06 PM
1) What version of Enterprise Library does the WCF Hands On Lab assume? EntLib 2.0, 2.0.1.0, 3.0?

2) HOL Exercise 11 states that ServiceFactory.ExceptionHandling project reference of EntLib binaries should be the same as the Registry entry used to find EntLib binaries at HKEYLOCALMACHINE\SOFTWARE\Microsoft\patterns and practices\Service Factory\EntlibBinaryPath. If they are different which one should be changed? I changed the project reference to match the Registry setting. I have the following settings:
HKEYLOCALMACHINE\SOFTWARE\Microsoft\patterns and practices\Service Factory\EntlibBinaryPath = C:\Program Files\Microsoft Service Factory\Enterprise Library Binaries\
Project Reference = C:\Program Files\Microsoft Service Factory\Enterprise Library Binaries\

3) Does the HOL assume Visual Studio "Team Suite"?
Exercise 11 uses namespace Microsoft.VisualStudio.TestTools.UnitTesting which is in dll Microsoft.VisualStudio.QualityTools.UnitTestFrameWork.dll which is only available with the "Team Suite" I believe. I am using Visual Studio 2005 Professional Edition version 8.0.50727.762 (SP.050727-7600).

4) HOL Exercise 11 Step 4:(8) when I click Finish I get error "An exception occurred during the binding of reference or execution of recipe GenerateWCFFaultContract. Error was: Action GenerateDataContractContent failed to execute: Exception of type 'Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TemplateExce
Microsoft.Practices.RecipeFramework.ActionExecutionException: An exception occurred during the binding of reference or execution of recipe GenerateWCFFaultContract. Error was: Action GenerateDataContractContent failed to execute:
Exception of type 'Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TemplateException' was thrown..
You can remove the reference to this recipe through the Guidance Package Manager. ---> Running transformation: System.InvalidCastException: Unable to cast object of type 'Microsoft.Practices.ServiceFactory.WCF.Editors.Grid.Data.WCFDataContractInfo' to type 'Microsoft.Practices.ServiceFactory.WCF.Editors.Grid.Data.WCFDataContractInfo'.
at Microsoft.VisualStudio.TextTemplating96ff33118dfd4c4f85cc862fad6917ff.GeneratedTextTransformation.get_WCFDataContractInfo()
at Microsoft.VisualStudio.TextTemplating96ff33118dfd4c4f85cc862fad6917ff.GeneratedTextTransformation.TransformText()
----------------------------------------------------------------------------------------------------

--- End of inner exception stack trace ---
at Microsoft.Practices.RecipeFramework.Recipe.UndoExecutedActionsAndRethrow(Exception ex)
at Microsoft.Practices.RecipeFramework.Recipe.ExecuteActions(IDictionaryService readOnlyArguments, IDictionaryService arguments, ITypeResolutionService resolution)
at Microsoft.Practices.RecipeFramework.Recipe.Execute(Boolean allowSuspend)
at Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(String recipe, IAssetReference reference, IDictionary arguments)
at Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(IAssetReference reference)
at Microsoft.Practices.RecipeFramework.RecipeReference.OnExecute()
at Microsoft.Practices.RecipeFramework.AssetReference.Execute()
at Microsoft.Practices.RecipeFramework.VisualStudio.RecipeMenuCommand.OnExec()
at Microsoft.Practices.RecipeFramework.VisualStudio.AssetMenuCommand.Invoke()

5) HOL Exercise 11 Step 4:(9) Add Exception Shielding gives error:
Microsoft.Practices.WizardFramework.WizardExecutionException: The wizard failed to execute. The error was:
Cannot create WizardPage Exception Shielding Properties, Could not load type 'Microsoft.Practices.ServiceFactory.WCF.CustomPages.ExceptionShieldingPage' from assembly 'Microsoft.Practices.ServiceFactory.WCF, Version=1.0.2546.32556, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.. ---> Microsoft.Practices.WizardFramework.WizardFrameworkException: Cannot create WizardPage Exception Shielding Properties, Could not load type 'Microsoft.Practices.ServiceFactory.WCF.CustomPages.ExceptionShieldingPage' from assembly 'Microsoft.Practices.ServiceFactory.WCF, Version=1.0.2546.32556, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.. ---> System.TypeLoadException: Could not load type 'Microsoft.Practices.ServiceFactory.WCF.CustomPages.ExceptionShieldingPage' from assembly 'Microsoft.Practices.ServiceFactory.WCF, Version=1.0.2546.32556, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
at System.Reflection.Assembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
at Microsoft.Practices.Common.Services.TypeResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
at Microsoft.Practices.Common.Services.AliasResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
at Microsoft.Practices.Common.Services.TypeResolutionService.GetType(String typeName, Boolean throwOnError)
at Microsoft.Practices.WizardFramework.WizardForm.CreateWizardPage(Page page)
--- End of inner exception stack trace ---
at Microsoft.Practices.WizardFramework.WizardForm.CreateWizardPage(Page page)
at Microsoft.Practices.WizardFramework.WizardForm.EndInit()
at Microsoft.Practices.WizardFramework.WizardForm..ctor(IServiceProvider provider, Wizard wizardConfig, String basePath)
at Microsoft.Practices.WizardFramework.WizardForm..ctor(IServiceProvider provider, Wizard wizardConfig)
at Microsoft.Practices.WizardFramework.WizardGatheringService.Microsoft.Practices.Common.Services.IValueGatheringService.Execute(XmlElement data, Boolean allowSuspend)
--- End of inner exception stack trace ---
at Microsoft.Practices.WizardFramework.WizardGatheringService.Microsoft.Practices.Common.Services.IValueGatheringService.Execute(XmlElement data, Boolean allowSuspend)
at Microsoft.Practices.RecipeFramework.Recipe.Execute(Boolean allowSuspend)
at Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(String recipe, IAssetReference reference, IDictionary arguments)
at Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(IAssetReference reference)
at Microsoft.Practices.RecipeFramework.RecipeReference.OnExecute()
at Microsoft.Practices.RecipeFramework.AssetReference.Execute()
at Microsoft.Practices.RecipeFramework.VisualStudio.RecipeMenuCommand.OnExec()
at Microsoft.Practices.RecipeFramework.VisualStudio.AssetMenuCommand.Invoke()

6) Exercise 11 has been a complete disaster for me. Exception Shielding is important and should be a recipe in the guidance package. Is there a version of the Guidance package that has Exception Shielding built in that can be downloaded?

Thanks for any help.
Developer
Apr 25, 2007 at 12:40 AM
1) Version is 2.0.1.0.
2) That path should be fine.
3) The tests in #11 assume that you have UnitTestFrameWork so if you don't have VSTS then you may adapt the test for NUnit or simple remove them from the sln.
4) Did you set the values specified in the document? In case you did, then you can simply bypass this step and copy the "MyFault.cs" file included in the Complete folder in the "Coho.ClubServices.Membership.ServiceContracts" project (That generated file is not part of the updated recipe).
5) Did you make a full re build of the sln and registered the package? Then you should select the "Custom WCF Guidance Package" (not the built in). I also assume that you could add the ExceptionShieldingPage and you could opent it in design mode so all the resources and UI objects are fine.

Let me know in case you still have trouble with this and I will see if I can publish a version of this GP with the Exception Shielding recipe.

Charly