CodeSmith支持.NET Framework 4.0
CodeSmith尚未正式支持.NET Framework 4.0,应该在6.0版本中会正式支持。现在的版本如果指定 CompilerVersion="4.0",会出现编译错误。
我们需要在CodeSmithStudio.exe.config文件中添加这句:
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
像这样:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin;AddIns;SchemaProviders"/>
</assemblyBinding>
</runtime>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
当然,或许你乐意在CodeSmith的其它配置文件中也添加这句。
具体可以参见CodeSmith官方论坛:http://community.codesmithtools.com/Support_Forums/f/3/p/11226/43512.aspx

浙公网安备 33010602011771号