Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > Binding error (?) using Smart Client Software Factory
 

Binding error (?) using Smart Client Software Factory

Cross posted with the SCSF forums here:
http://www.codeplex.com/smartclient/Thread/View.aspx?ThreadId=10242

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
James Chaldecott  Monday, May 14, 2007 3:18 PM

Hi James,

Please let us know if you were able to look at fusion logs and fix this issue.

-Victor.

vga  Saturday, June 02, 2007 5:29 AM
Hi Victor. Sorry for the delay.

I just got free of my other work and back to SCSF. Guess what: It works now!

Weird. The only thing I can think of is that in the meantime I've upgraded TestDriven.Net, CodeRush & "Refactor Pro!" on this machine, so maybe the previous version of one of those was causing problems.

...

Ah! Now I find it. It was reported & fixed in DXCore (part of CodeRush, etc):
http://www.devexpress.com/Support/Center/ViewIssue.aspx?issueid=CB15784

Sorry for the interruption. At least it's here for the archives, now.

James
James Chaldecott  Tuesday, June 05, 2007 3:50 PM

Hi James,

It seems an issue with the state of the references, when you closethe solution the current referencesare saved in the gpstate file. For some reason one of those references has an invalid reference, a workaround could be delete the gpstate file and rebind the package in your solution. Anyway the Smart Client team will give you a better response about this issue.

hope it helps.

Jose

Jose Escrich  Tuesday, May 15, 2007 1:45 AM
Thanks for that, it sort of helped, but my problem isn't completely solved.

If I delete the gpstate file, I can load the solution (no SCSF guidance). I can then immediately re-enable the SCSF guidance using the guidance package manager (GPM).

If I load the solution with the gpstate file still there, it gives me the exception above. If I click "Yes" to remove the guidance from the solution it does something similar to deleting the gpstate file. At this point though, it gives me an exception if I try to add the SCSF guidance using the GPM. I have to restart VS2005 before it will allow me to add the guidance back.

Monitoring the process using Filemon, I can see that when I successfully add the guidance, it is probing for the guidance assembly (Microsoft.Practices.SmartClientFactory.GuidancePackage.dll) in the GAC, then in the IDE folder (i.e. the AppBase) and it's PublicAssemblies & PrivateAssemblies subfolders (as specified in "devenv.exe.config"), and then finally it looks for it in the correct folder: "C:\Program Files\Microsoft Smart Client Factory\Guidance Package".

When it fails, it doesn't even try to load from that final (correct) location, so the binding fails. Has anyone got any idea how the binding is controlled in VS when it comes to GAX? What makes it look in the correct location (it's not normal binding policy)? What's different about binding in the GPM and at solution load time?

Thanks,

James
James Chaldecott  Tuesday, May 15, 2007 11:13 AM

The probing is doing over the private gp folder and also in the PublicAssemblies Vs folder.

You can also use Fusion in order to find out where is try to find the assemblies (in a Vs command prompt run fuslogvw).

Jose Escrich  Tuesday, May 15, 2007 2:56 PM
I think my problem is that (only during the solution load) it isn't attempting to probe the private gp folder. Any idea why?

I don't think I've yet managed to get fuslogvw to show me the failed binds, for some reason. I've used it before and I can see failed binds outside of VS, but for some reason I don't think it's been showing me this one. I'll check again tomorrow when I'm back at work.

James Chaldecott  Tuesday, May 15, 2007 7:25 PM

Hi James,

Please let us know if you were able to look at fusion logs and fix this issue.

-Victor.

vga  Saturday, June 02, 2007 5:29 AM
Hi Victor. Sorry for the delay.

I just got free of my other work and back to SCSF. Guess what: It works now!

Weird. The only thing I can think of is that in the meantime I've upgraded TestDriven.Net, CodeRush & "Refactor Pro!" on this machine, so maybe the previous version of one of those was causing problems.

...

Ah! Now I find it. It was reported & fixed in DXCore (part of CodeRush, etc):
http://www.devexpress.com/Support/Center/ViewIssue.aspx?issueid=CB15784

Sorry for the interruption. At least it's here for the archives, now.

James
James Chaldecott  Tuesday, June 05, 2007 3:50 PM
Glad its fixed now, and thanks for reporting back!
vga  Wednesday, June 06, 2007 2:19 PM

James,

I just want to thank you for taking the time to post back your solution. I was also running an older version of DXCore and getting really frustrated by this, spending several hours looking in all the wrong places.

Thanks again!

John

John Holliday  Friday, August 17, 2007 9:41 AM

You can use google to search for other answers

Custom Search

More Threads

• Loosing Item Template Information
• An Alternate way to create a Deployment Project for a Guidance Package
• GAX/GAT breaking DSL
• URGENT: Project and Item Templates issue!
• Adding drop down menu using editor
• warnings when I try to create guidance package
• Guidance Automation Toolkit installation problems
• Create Typed Dataset with EnvDTE
• Simulate DependentUpon with DTE class
• Clarius SFT (Jun07) and GAT (Feb08): do they work together?