食谱执行中的异常 [英] exception in execution of recipe

查看:80
本文介绍了食谱执行中的异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Microsoft.Practices.RecipeFramework.ActionExecutionException:绑定引用或执行配方时发生异常。错误是:操作无法执行:
抛出类型'Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TemplateException'的异常。
您可以通过Guidance Package Manager删除对此配方的引用。



编译转换:名称空间'System'中不存在类型或命名空间名称'CodeDom'(您是否缺少程序集引用?)
- -------------------------------------------------- ------------------------------------------------ <无线电通信>编译转换:名称空间'System'中不存在类型或命名空间名称'CodeDom'(您是否缺少程序集引用?)
----------------- -------------------------------------------------- ---------------------------------
编译转换:类型'System.CodeDom.Compiler.CompilerErrorCollection'在未引用的程序集中定义。您必须添加对程序集'System,Version = 2.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'的引用。
---------------------- -------------------------------------------------- ----------------------------
编译转换:'System.CodeDom.Compiler.CompilerErrorCollection'不包含'的定义'添加"点击--------------------------------------------- -------------------------------------------------- -----


---内部异常堆栈跟踪结束---来自Microsoft的Microsoft.Practices.RecipeFramework.Recipe.UndoExecutedActionsAndRethrow(Exception ex)
.Practices.RecipeFramework.Recipe.ExecuteActions(IDictionaryService readOnlyArguments,IDictionaryService参数,ITypeResolutionService解析)
at Microsoft.Practices.RecipeFramework.Recipe.Execute(Boolean allowSuspend)
at Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(String recipe,IAssetReference引用,IDictionary参数s)
Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(IAssetReference reference)
at Microsoft.Practices.RecipeFramework.RecipeReference.OnExecute()
at Microsoft.Practices.RecipeFramework.VisualStudio.VsBoundReference.OnExecute( )
Microsoft.Practices.RecipeFramework.AssetReference.Execute()
at Microsoft.Practices.RecipeFramework.VisualStudio.RecipeMenuCommand.OnExec()
at Microsoft.Practices.RecipeFramework.VisualStudio.AssetMenuCommand.Invoke()

解决方案



我没有太多的背景,但我猜你正试图运行一个文本模板如果是这样,您必须在模板中添加程序集引用。例如,如果您在模板中使用System.Xml,则应该具有:

< ;#@ Assembly name =" System.Xml.dll" #>
<#@ Import namespace =" System.Xml" #>
的搜索结果,搜索HTH圣何塞结果

Microsoft.Practices.RecipeFramework.ActionExecutionException: An exception occurred during the binding of reference or execution of recipe . Error was: Action  failed to execute:
Exception of type 'Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TemplateException' was thrown..
You can remove the reference to this recipe through the Guidance Package Manager.


Compiling transformation: The type or namespace name 'CodeDom' does not exist in the namespace 'System' (are you missing an assembly reference?)
----------------------------------------------------------------------------------------------------
Compiling transformation: The type or namespace name 'CodeDom' does not exist in the namespace 'System' (are you missing an assembly reference?)
----------------------------------------------------------------------------------------------------
Compiling transformation: The type 'System.CodeDom.Compiler.CompilerErrorCollection' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
----------------------------------------------------------------------------------------------------
Compiling transformation: 'System.CodeDom.Compiler.CompilerErrorCollection' does not contain a definition for 'Add'
----------------------------------------------------------------------------------------------------

   --- 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.VisualStudio.VsBoundReference.OnExecute()
   at Microsoft.Practices.RecipeFramework.AssetReference.Execute()
   at Microsoft.Practices.RecipeFramework.VisualStudio.RecipeMenuCommand.OnExec()
   at Microsoft.Practices.RecipeFramework.VisualStudio.AssetMenuCommand.Invoke()

解决方案

Hi,

I don't have to much context but I'm guessing that you're trying to run a text template if so, you have to add the assembly references in your template.

for example if you're using the System.Xml in your template you should have:

<#@ Assembly name="System.Xml.dll" #>
<#@ Import namespace="System.Xml" #>


hth
jose.


这篇关于食谱执行中的异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆