I have a T4 template to generate C# classes for the entities backing my .edmx model. The template starts with this header:
<#@ template language="C#" debug="false" hostspecific="true"#>
<#@ include file="EF.Utility.CS.ttinclude"#>
<#@ output extension=".cs"#>
Attempting to build the project results in these errors
error CS0234: The type or namespace name 'Design' does not exist in the namespace 'System.Data.Entity'...
error CS0246: The type or namespace name 'EnvDTE' could not be found (are you missing a using directive...
error CS0234: The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft'...
How can I fix this?
It turns out than, based on a VS Extensibility thread, the reason for the problem was
the Clarius Visual T4 extension. It reset this node in the
.csprojfile to
from
The solution is to manually change the node to
Nonein the.csprojfile. Changing itback via the Visual Studio properties editor for the
.ttfile does not work.Finally, disabling the extension prevents this from happening again.