2

我有 vs2010,从 nuget 安装了 Entity framework 4.3.1,从 microsoft 安装了 EF 4.x DbContext Generator。我创建了一个项目,然后尝试添加一个新的 EF 4.x DbContext Generator 项目,但出现以下错误。有谁知道如何解决这个问题?

错误 1 ​​运行转换:System.Reflection.TargetInvocationException:调用目标已引发异常。---> System.IO.FileNotFoundException: Unable to locate file at Microsoft.VisualStudio.TextTemplating.VSHost.TextTemplatingService.ResolvePath(String path) at Microsoft.VisualStudio.TextTemplating.VSHost.TextTemplatingService.ResolvePath(String path) --- End内部异常堆栈跟踪 --- 在 System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo 方法,对象目标,Object[] 参数,SignatureStruct& sig,MethodAttributes methodAttributes,RuntimeType typeOwner) 在 System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo 方法,对象目标,对象 [ ] 参数,签名 sig,MethodAttributes methodAttributes,
at Microsoft.VisualStudio.TextTemplatingE78BCB29E8D7A2F9432A449161229C3F.GeneratedTextTransformation.DynamicHost.ResolvePath(String path) at Microsoft.VisualStudio.TextTemplatingE78BCB29E8D7A2F9432A449161229C3F.GeneratedTextTransformation.MetadataLoader.TryCreateEdmItemCollection(String sourcePath, String[] referenceSchemas, EdmItemCollection& edmItemCollection) at Microsoft.VisualStudio.TextTemplatingE78BCB29E8D7A2F9432A449161229C3F.GeneratedTextTransformation.MetadataLoader .CreateEdmItemCollection(String sourcePath, String[] referenceSchemas) 在 Microsoft.VisualStudio.TextTemplatingE78BCB29E8D7A2F9432A449161229C3F.GeneratedTextTransformation.MetadataLoader.TryLoadAllMetadata(String inputFile, MetadataWorkspace& metadataWorkspace) 在 Microsoft.VisualStudio.TextTemplatingE78BCB29E8D7A16229C32A449133GeneratedTextTransformation.TransformText() at Microsoft.VisualStudio.TextTemplating.TransformationRunner.RunTransformation(TemplateProcessingSession session, String source, ITextTemplatingEngineHost host, String& result) 1 1

4

1 回答 1

6

显然它是PEBKAC的一个案例。我还没有创建我的 edmx 文件。完成此操作后,我需要做的就是右键单击模型。选择“添加代码生成项”。

于 2012-06-29T10:39:12.633 回答