Failed to load base class 'DynamicTransform' from which Transformation class inherits

May 8, 2012 at 2:20 PM

I have download the Scaffolding project.

I open the RazorView folder,and I thought the _CreateOrEdit.cs.t4 file could create the _CreateOrEdit.cshtml as the description in http://msdn.microsoft.com/en-us/library/dd820620.aspx.

But I don‘t understand why I create a .tt file and add the code below:

<#@ Template Language="C#" HostSpecific="True" Inherits="DynamicTransform" #><#@ Output extension="cshtml" #><#@ assembly name="System.ComponentModel.DataAnnotations" #><#@ assembly name="System.Core" #><#@ assembly name="System.Data.Entity" #><#@ assembly name="System.Data.Linq" #><#@ import namespace="System" #><#@ import namespace="System.Collections" #><#@ import namespace="System.Collections.Generic" #><#@ import namespace="System.ComponentModel.DataAnnotations" #><#@ import namespace="System.Data.Linq.Mapping" #><#@ import namespace="System.Data.Objects.DataClasses" #><#@ import namespace="System.Linq" #><#@ import namespace="System.Reflection" #><# var viewDataType = (EnvDTE.CodeType) Model.ViewDataType; #><# if(viewDataType != null) { #>@model <#= viewDataType.FullName #>
<# } #>@* This partial view defines form fields that will appear when creating and editing entities *@
<#foreach (ModelProperty property in GetModelProperties(Model.ViewDataType, false)) {    if (!property.IsPrimaryKey && !property.IsForeignKey && !property.IsReadOnly) {#><div class="editor-label">    @Html.LabelFor(model => model.<#= property.Name #>)</div><div class="editor-field">    @Html.EditorFor(model => model.<#= property.Name #>)    @Html.ValidationMessageFor(model => model.<#= property.Name #>)</div>
<#    }}#><#foreach (RelatedEntityInfo relation in ParentRelations) {#><div class="editor-label">    <#= relation.RelationName #></div><div class="editor-field">    @Html.DropDownListFor(model => model.<#= relation.RelationProperty.Name #>, ((IEnumerable<<#= relation.RelatedEntityType.FullName #>>)ViewBag.Possible<#= relation.RelationNamePlural #>).Select(option => new SelectListItem {        Text = <#= GetValueExpression("option", relation.RelatedEntityType) #>,         Value = option.<#= relation.RelatedEntityPrimaryKeyName #>.ToString(),        Selected = (Model != null) && (option.<#= relation.RelatedEntityPrimaryKeyName #> == Model.<#= relation.RelationProperty.Name #>)    }), "Choose...")    @Html.ValidationMessageFor(model => model.<#= relation.RelationProperty.Name #>)</div><#}#>

the VS could not create a .cshtml which I except.And I recieve a error "Failed to load base class 'DynamicTransform' from which Transformation class inherits. "

Who can help me solve the problem?