Exception using the Event Publication Receipe

Topics: CAB & Smart Client Software Factory
Mar 4, 2006 at 7:00 AM
originally posted by: timnelson

Trying to add a simple event publication on a View SmartPart class. Topic named is topic:://DateChanged, scope is Global and it is using System.EventArgs. Is complaining about a parameter being incorrect. Can someone shed some light on this?

----- Exception and trace below ----

Microsoft.Practices.RecipeFramework.ActionExecutionException: An exception occurred during the binding of reference or execution of recipe AddEventPublication. Error was: Action AddEvent failed to execute:
The parameter is incorrect..
You can remove the reference to this recipe through the Guidance Package Manager. ---> System.ArgumentException: The parameter is incorrect.
at EnvDTE80.CodeClass2.AddEvent(String Name, String FullDelegateName, Boolean CreatePropertyStyleEvent, Object Location, vsCMAccess Access)
at Microsoft.Practices.GuidanceAutomation.SmartClient.Library.CodeModel.Actions.AddEventAction.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.GuidancePackage.Execute(IAssetReference reference)
at Microsoft.Practices.RecipeFramework.RecipeReference.OnExecute()
at Microsoft.Practices.RecipeFramework.AssetReference.Execute()
at Microsoft.Practices.RecipeFramework.PackageManagement.PackageManager.OnExecuteRecipe(Object sender, EventArgs e)
Mar 15, 2006 at 10:06 AM
originally posted by: DamReev

I have the same issue
Mar 15, 2006 at 1:16 PM
originally posted by: DeivaShankar

Topic names should not have any special characters. They should be valid C# Variable names.
Mar 15, 2006 at 1:24 PM
originally posted by: DamReev

I take it back my error is different.

Stack Trace after attempting to add a publication called TestEventPublication:

Microsoft.Practices.RecipeFramework.RecipeExecutionException: An exception occurred during the binding of reference or execution of recipe AddEventPublication. Error was: The following arguments are required and don't have values: CommonProjectGuid, CommonProject, EventTopicNamesCodeClass. Can't continue execution..
You can remove the reference to this recipe through the Guidance Package Manager.
at Microsoft.Practices.RecipeFramework.Recipe.ThrowIfRequiredArgumentsAreNull(IDictionaryService arguments)
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()
Mar 15, 2006 at 1:36 PM
originally posted by: Deiva_Infosys

Are you using the recipe on a Solution that was created using "Light Weight Smart Client" Solution Template or on a solution that you had previously created?
Mar 15, 2006 at 1:42 PM
originally posted by: DamReev

In this case it is another solution, but I tried doing this in a solution created from the Light Weight Smart Client and also got an error, the stack trace follows.

Microsoft.Practices.RecipeFramework.ActionExecutionException: An exception occurred during the binding of reference or execution of recipe AddEventPublication. Error was: Action SetMethodAsVirtual failed to execute:
Unspecified error.
You can remove the reference to this recipe through the Guidance Package Manager. ---> System.Runtime.InteropServices.COMException (0x80004005): Unspecified error
at EnvDTE.CodeFunction.set_CanOverride(Boolean pCanOverride)
at Microsoft.Practices.GuidanceAutomation.SmartClient.Actions.UpdateEventFireMethodAction.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.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()
---> Microsoft.Practices.RecipeFramework.UndoActionException: Action AddFireMethod failed to perform undo operation:
The parameter is incorrect. ---> System.ArgumentException: The parameter is incorrect.
at EnvDTE.CodeClass.RemoveMember(Object Element)
at Microsoft.Practices.GuidanceAutomation.SmartClient.Library.CodeModel.Actions.AddMethodAction.Undo()
at Microsoft.Practices.RecipeFramework.Recipe.UndoExecutedActionsAndRethrow(Exception ex)
--- End of inner exception stack trace ---