Error loading SCSF solution

Topics: CAB & Smart Client Software Factory
May 14, 2007 at 3:11 PM
Edited May 14, 2007 at 3:22 PM
I've tried installing both the June 2006 & May 2007 (R10 & R11) versions of SCSF and I'm getting the same problem with both of them.

I can create a new "Smart Client Application" OK, and so far everything seems to work fine whilst I've got it open in VS immediately after creating it. Once I close the solution & try and re-load it, however, I get the error below:

Unexpected error loading property SmartClientFactoryPackage
Do you want to permanently remove the package from the current solution?
 
System.Runtime.Serialization.SerializationException: Unexpected error loading property SmartClientFactoryPackage ---> System.Runtime.Serialization.SerializationException: Unable to find assembly 'Microsoft.Practices.SmartClientFactory.GuidancePackage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
   at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
   at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)
   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
   at Microsoft.Practices.RecipeFramework.VisualStudio.SolutionPackagesContainer.DeserializeFromBinary(Byte[] data)
   at Microsoft.Practices.RecipeFramework.VisualStudio.SolutionPackagesContainer.DeserializePackage(GuidancePackagesStatePackage package)
   --- End of inner exception stack trace ---
   at Microsoft.Practices.RecipeFramework.VisualStudio.SolutionPackagesContainer.DeserializePackage(GuidancePackagesStatePackage package)

Once I've loaded the solution (clicking "No"), the SCSF guidance is (unsurprisingly) not available.

I then tried using the Guidance Package Manager to add the SCSF guidance back. "Smart Client Development May 2007" is in the "Enable/Disable Packages" list, and the "Explore selected package" functionality works, but trying to enable it for the solution gives the following error:

Cannot load package Smart Client Development May 2007
 
Microsoft.Practices.RecipeFramework.ActionExecutionException: An exception occurred during the binding of reference or execution of recipe BindingRecipe. Error was: Action FoundationalModuleRefCS failed to execute:
Microsoft.Practices.SmartClientFactory.References.ModuleTemplateReference, Microsoft.Practices.SmartClientFactory.GuidancePackage. 
You can remove the reference to this recipe through the Guidance Package Manager. ---> System.TypeLoadException: Microsoft.Practices.SmartClientFactory.References.ModuleTemplateReference, Microsoft.Practices.SmartClientFactory.GuidancePackage ---> System.IO.FileLoadException: The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
   at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
   at Microsoft.Practices.Common.Services.TypeResolutionService.GetAssembly(AssemblyName assemblyName, Boolean throwOnError)
   at Microsoft.Practices.Common.Services.TypeResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
   --- End of inner exception stack trace ---
   at Microsoft.Practices.Common.Services.TypeResolutionService.GetType(String typeName, 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.RecipeFramework.Library.Actions.CreateUnboundReferenceAction.Execute()
   at Microsoft.Practices.RecipeFramework.Recipe.Microsoft.Practices.RecipeFramework.Services.IActionExecutionService.Execute(String actionName, Dictionary`2 inputValues)
   at Microsoft.Practices.RecipeFramework.Recipe.Microsoft.Practices.RecipeFramework.Services.IActionExecutionService.Execute(String actionName)
   at Microsoft.Practices.RecipeFramework.Recipe.Microsoft.Practices.RecipeFramework.Services.IActionCoordinationService.Run(Dictionary`2 declaredActions, XmlElement coordinationData)
   at Microsoft.Practices.RecipeFramework.Recipe.ExecuteActions(IDictionaryService readOnlyArguments, IDictionaryService arguments, ITypeResolutionService resolution)
   --- 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.RecipeManager.Add(IComponent component, String name)
   at System.ComponentModel.Container.Add(IComponent component)
   at Microsoft.Practices.RecipeFramework.RecipeManager.EnablePackage(XmlReader configuration)
   at Microsoft.Practices.RecipeFramework.RecipeManager.EnablePackage(String packageName)
   at Microsoft.Practices.RecipeFramework.PackageManagement.EnableDisablePackages.OnOkClick(Object sender, EventArgs e)

Any ideas? Is there a GAX forum where I should post this?

I'm guessing that the assembly search path isn't being set right somewhere, but I don't know where to fix it.

It might be worth adding that I do have the following entry in the registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\patterns and practices\Smart Client Factory
    MicrosoftPracticesLibraryBinaryPath = C:\Program Files\Microsoft Smart Client Factory\Lib\

James

Edit @ 16:22: Added formatting for error messages
May 14, 2007 at 3:20 PM
Edited May 15, 2007 at 11:16 AM
Cross-posted to GAT forums here:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1597593&SiteID=1

Edit: There's some more info there, now. I'm pretty sure it's something to do with how VS is trying to find the guidance assembly.
Jun 5, 2007 at 3:55 PM
This turned out to be a bug in DXCore (part of CodeRush, etc):
http://www.devexpress.com/Support/Center/ViewIssue.aspx?issueid=CB15784

It's now fixed.