I am trying to use T4Scaffolding for my current project but it fails at the beginning.
I do step by step same process on this link that teaches how to use T4Scaffolding for a basic console application.
Steps that I did
1- I created a new console application (.NET 4.0)
2- I installed T4Scaffholding successfully by using package manager console (install-package t4scaffolding)
3- I tried to create a demo custom template by using package manager console like
Scaffold CustomScaffolder T4Demo
then it throws the exception below
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
What am I doing wrong ?
After I changed my windows regional setting from my native language to USA, the problem has gone. Do not forget to restart Visual Studio.
really annoying problem !