我正试图在我当前的项目中使用T4Scaffolding,但它在一开始就失败了。
我在此链接上一步一步地学习如何在基本控制台应用程序中使用T4Scaffolding。
我做的步骤
1- i创建了一个新的控制台应用程序(.NET 4.0)
2- i通过使用包管理器控制台(Install t4scaffolding)成功地安装了T4Scaffholding
3-我尝试使用包管理器控制台创建一个自定义模板,如
Scaffold CustomScaffolder T4Demo
然后抛出下面的异常
Add-ProjectItemViaTemplate : c:\Users\ryu\Desktop\SpiderWeb\ConsoleApplication2\packages\T4Scaffolding.Core.1.0.0\tools\CustomScaffolder\DefaultPs1Script.ps1.t4(1,48) : error CS0246: Com
piling transformation: The type or namespace name 'DynamicTransform' could not be found (are you missing a using directive or an assembly reference?)
At C:\Users\ryu\Desktop\SpiderWeb\ConsoleApplication2\packages\T4Scaffolding.Core.1.0.0\tools\CustomScaffolder\T4Scaffolding.CustomScaffolder.ps1:15 char:1
+ Add-ProjectItemViaTemplate $outputPath -Template DefaultPs1Script -Model @{
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Add-ProjectItemViaTemplate], Exception
+ FullyQualifiedErrorId : T4Scaffolding.Cmdlets.AddProjectItemViaTemplateCmdlet
Add-ProjectItemViaTemplate : c:\Users\ryu\Desktop\SpiderWeb\ConsoleApplication2\packages\T4Scaffolding.Core.1.0.0\tools\CustomScaffolder\DefaultT4Template.cs.t4(1,48) : error CS0246: Com
piling transformation: The type or namespace name 'DynamicTransform' could not be found (are you missing a using directive or an assembly reference?)
At C:\Users\ryu\Desktop\SpiderWeb\ConsoleApplication2\packages\T4Scaffolding.Core.1.0.0\tools\CustomScaffolder\T4Scaffolding.CustomScaffolder.ps1:22 char:1
+ Add-ProjectItemViaTemplate $outputPath -Template DefaultT4Template -Model @{
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Add-ProjectItemViaTemplate], Exception
+ FullyQualifiedErrorId : T4Scaffolding.Cmdlets.AddProjectItemViaTemplateCmdlet我做错什么了?
发布于 2013-03-29 11:16:05
当我把我的windows区域设置从我的母语改为美国之后,问题就消失了。不要忘记重新启动Visual。
真是烦人的问题!
https://stackoverflow.com/questions/15700764
复制相似问题