Guidance package issue. Add WPF View with Presenter

Topics: CAB & Smart Client Software Factory
Jul 20, 2007 at 12:13 PM
Hi Friends,

I chose to develop my smart client product using SCSF May release with 3.0 enterprise library. I have created my solution using the SCSF Guidance package. Created few business modules and some views inside that using Guidance Package. Everything was working fine. But suddenly after few weeks I am facing a strange problem. When I added new business module inside my solutions and try to right click onto the project to add WPF view with presenter. There is not context item displayed 'Add WPF view with presenter' which was earlier displaying whenever I right click onto the "View" folder of the business module. I also tried this using the Visual studio tools/guidance package manager. But after selecting the particular recipe the "Accept" button is disabled. It would be great if somebody can help me out to restore my Guidance package setting.

Thanks
Hiren
Jul 20, 2007 at 2:12 PM
As from the Help file:

"The View (with presenter) recipe adds three items to an existing C# project in a smart client solution. It requires that you have an existing smart client solution with a C# project.

The smart client solution must contain the Infrastructure.Interface project with the Presenter base class, located in the rootnamespace.Infrastructure.Interface namespace (for example, GlobalBank.Infrastructure.Interface). The recipe extends this class to create a specific presenter for the view."

Is it possible you removed or renamed this project?
Jul 20, 2007 at 8:03 PM
Only a few comments over the last post:

  • If you removed the Infrastructure.Interface project of the solution you would have two exceptions regarding to an error in the IsEnabledFor method every time you right clicked over a project or a file. From what can be seen from your comments, this is not your case.
  • "The View (with presenter) recipe adds three items to an existing C# project in a smart client solution. It requires that you have an existing smart client solution with a C# project.” Moreover, this applies to VB too.

As rsiddiqui says, this may be happening if you renamed your Infrastructure.Interface project.

Please let me know if this helps,

Ezequiel Jadib
http://staff.southworks.net/blogs/ejadib
Jul 24, 2007 at 5:49 AM
Hi rsiddiqui,

First of all thanks for all you friends' reply. Namespace.Intrastructure.Interface project is as it is generated by guidance package. Yeah, one change I have made that is I changed the output assembly name from Infrastructure.Interface.dll to Namespace.Infrastructure.Interface.dll inside the project properties. And moreover when I added business module for the solution it ended up throwing me one error. But after that error business module get successfully added into my solution. Now when I try to add WPF with presenter inside that business module there is no context item displayed. Is that something do with the error when adding business module restricting context menu item to be displayed? I have the error dialog displaying something like this.

Recipe framework error

An exception occured during the binding of reference or excecution of recipe Createbusinessmodule.cs. Error was Action AddSharedModule failed to execute: Object reference is not set to an instance of an object. You can remove the reference to this recipe through the Guidance Package Manager.

Microsoft.Practices.RecipeFramework.ActionExecutionException: An exception occurred during the binding of reference or execution of recipe CreateBusinessModuleCS. Error was: Action AddSharedModule failed to execute:
Object reference not set to an instance of an object..
You can remove the reference to this recipe through the Guidance Package Manager. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Practices.SmartClientFactory.Actions.AddSharedModuleAction.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.Extensions.Coordinators.ConditionalCoordinator.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.GuidancePackage.ExecuteFromTemplate(String recipe, IDictionary arguments)
at Microsoft.Practices.RecipeFramework.VisualStudio.Templates.UnfoldTemplate.ExecuteRecipe(Boolean executeActions)
at Microsoft.Practices.RecipeFramework.VisualStudio.Templates.UnfoldTemplate.RunFinished()



rsiddiqui wrote:
As from the Help file:

"The View (with presenter) recipe adds three items to an existing C# project in a smart client solution. It requires that you have an existing smart client solution with a C# project.

The smart client solution must contain the Infrastructure.Interface project with the Presenter base class, located in the rootnamespace.Infrastructure.Interface namespace (for example, GlobalBank.Infrastructure.Interface). The recipe extends this class to create a specific presenter for the view."

Is it possible you removed or renamed this project?