我正在使用 .Net4.5 在 VS2012 中创建一个控制台项目。 之后,我向项目“添加”、“新项目”,然后选择“EF 5.x DbContext Generator”。 然后,几秒钟后,以下错误消息出现在“错误列表”选项卡中:
Error 1 Running transformation: Please overwrite the replacement token '$edmxInputFile$' with the actual name of the .edmx file you would like to generate from. C:\Projects\Tests\ConsoleAppEF5\ConsoleAppEF5\Model1.tt`
我该如何解决这个问题?
我错过了什么?
最佳答案
您应该首先创建 edmx 模型以从中自动生成 POCO。您可以通过菜单添加它(添加新项 -> ADO.NET 实体数据模型)。创建模型后,您可以使用 DbContext 生成器。将 $edmxInputFile$ 替换为您的 edmx 文件的名称,然后保存您正在编辑的文件(尽管 VS 2012 应该会自动执行)。
关于c# - EF5 启动项目 :Error Running transformation: Please overwrite the replacement token '$edmxInputFile$' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16610602/