Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > Can't create my own action
 

Can't create my own action

Hi, i have define my own action like this:

namespace TacticsConferenceSite.Actions

{

[ServiceDependency(typeof(DTE))]

public class AddItemBooleanConditionAction : Action

{

......code

}

In my xml file i have defined the action like this>

<Action Name="AgregarClaseSecreta" Type="TacticsConferenceSite.Actions.AddItemBooleanCondition, TacticsConferenceSite">

<Input Name="Content" ActionOutput="GenerarClaseSecreta.Content" />

<Input Name="TargetFileName" RecipeArgument="NombreClaseSecreta" />

<Input Name="Project" ActionOutput="GetRuntimeProjectCommon.Project" />

<Input Name="Condicion" RecipeArgument="CheckBoxEspecial"></Input>

</Action>

When i go to new project an create a project of this type, i get the following exception:

System.TypeLoadException: No se puede cargar el tipo 'TacticsConferenceSite.Actions.AddItemBooleanCondition' del ensamblado'TacticsConferenceSite, Version=1.0.2805.2879, Culture=neutral, PublicKeyToken=null'.
en System.Reflection.Assembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
en Microsoft.Practices.Common.Services.TypeResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
en Microsoft.Practices.Common.Services.AliasResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
en Microsoft.Practices.Common.Services.TypeResolutionService.GetType(String typeName, Boolean throwOnError)
en Microsoft.Practices.RecipeFramework.Recipe.GetInstance[T](ITypeResolutionService resolution, String concreteType)
en Microsoft.Practices.RecipeFramework.Recipe.LoadActionsFromConfiguration(ITypeResolutionService resolution)
en Microsoft.Practices.RecipeFramework.Recipe.ExecuteActions(IDictionaryService readOnlyArguments, IDictionaryService arguments, ITypeResolutionService resolution)
en Microsoft.Practices.RecipeFramework.Recipe.Execute(Boolean allowSuspend)
en Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(String recipe, IAssetReference reference, IDictionary arguments)
en Microsoft.Practices.RecipeFramework.GuidancePackage.ExecuteFromTemplate(String recipe, IDictionary arguments)
en Microsoft.Practices.RecipeFramework.VisualStudio.Templates.UnfoldTemplate.ExecuteRecipe(Boolean executeActions)
en Microsoft.Practices.RecipeFramework.VisualStudio.Templates.UnfoldTemplate.RunFinished()

What am i doing wrong?

Please Help

Thanks,

Martin

Mar77incho  Thursday, September 06, 2007 4:46 AM
Hi Martin, It seems you missed the action type name in the Xml. The Action type name is AddItemBooleanConditionAction and in the xml is AddItemBooleanCondition. So it should be:

<Action Name="AgregarClaseSecreta" Type="TacticsConferenceSite.Actions.AddItemBooleanConditionAction, TacticsConferenceSite">

<Input Name="Content" ActionOutput="GenerarClaseSecreta.Content" />

<Input Name="TargetFileName" RecipeArgument="NombreClaseSecreta" />

<Input Name="Project" ActionOutput="GetRuntimeProjectCommon.Project" />

<Input Name="Condicion" RecipeArgument="CheckBoxEspecial"></Input>

</Action>


HTH,
-Adrian
Adrian Alonso  Thursday, September 06, 2007 12:34 PM

I think this is caused by what Adrian points out. As an added tip everytime you geta "TypeLoadException" (i.e. "No se puede cargar el tipo..." in spanish) you should use Fusion viewer (installed in .Net SDK in the "sdk" folder under Visual Studio install path) to log all binding failures. This will tell you which places is fusion trying to load your assemblies from, and if you verify the places are OK, then most probably is a typo in the type name (as in your case).

-Victor.

vga  Friday, September 07, 2007 5:17 AM
Hi Martin, It seems you missed the action type name in the Xml. The Action type name is AddItemBooleanConditionAction and in the xml is AddItemBooleanCondition. So it should be:

<Action Name="AgregarClaseSecreta" Type="TacticsConferenceSite.Actions.AddItemBooleanConditionAction, TacticsConferenceSite">

<Input Name="Content" ActionOutput="GenerarClaseSecreta.Content" />

<Input Name="TargetFileName" RecipeArgument="NombreClaseSecreta" />

<Input Name="Project" ActionOutput="GetRuntimeProjectCommon.Project" />

<Input Name="Condicion" RecipeArgument="CheckBoxEspecial"></Input>

</Action>


HTH,
-Adrian
Adrian Alonso  Thursday, September 06, 2007 12:34 PM

I think this is caused by what Adrian points out. As an added tip everytime you geta "TypeLoadException" (i.e. "No se puede cargar el tipo..." in spanish) you should use Fusion viewer (installed in .Net SDK in the "sdk" folder under Visual Studio install path) to log all binding failures. This will tell you which places is fusion trying to load your assemblies from, and if you verify the places are OK, then most probably is a typo in the type name (as in your case).

-Victor.

vga  Friday, September 07, 2007 5:17 AM

You can use google to search for other answers

Custom Search

More Threads

• Error using Project template - Package templates may not be properly registered.
• Microsoft.VisualStudio.TextTemplating 8.2
• Create class generated from T4 template into Project Folder
• Schema Discovery component
• How do I add an empty project folder?
• Will we see an updated GAT Toolkit soon?
• Server Application Unavailable
• visual studio 2008 GAT
• Value Editor in custom wizard
• Recipe Framework Error when created SCSF project