简体   繁体   中英

Simple T4 template doesn't work in Visual Studio 2010, but does in MonoDevelop?

I'm having all sorts of hell getting Visual Studio 2010 to compile my T4 template. I am pretty sure this same template worked on 2008, but I can't confirm right now. I know for sure it works on MonoDevelop.

Anyway, here is the header of my template:

<#@ template language="C#v3.5" hostspecific="true" #>
<#@ output extension="cs" #>
<#@ assembly name=“System.Core” #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System" #>
<#@ import namespace="System.Linq" #>

Visual Studio 2010 complains abut the first line, the template directive:

A directive was specified in the wrong format. The transformation will not be run. Please specify the directive in the format <#@ name [parameterName="parameterValue"]* #>

Why is this not working as expected?

My problem was that I copy and pasted the assembly directive and it used “” instead of ""

Also, I figured out that the line number it gives as the error is basically pointless.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM