I have vs2010, installed Entity framework 4.3.1 from nuget, installed the EF 4.x DbContext Generator from microsoft. I create a project then try to add a new EF 4.x DbContext Generator item but the following error. Does anyone know how to resolve this?
Error 1 Running transformation:
System.Reflection.TargetInvocationException: Exception has been thrown
by the target of an invocation. —> 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 of inner exception stack trace — at
System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo
method, Object target, Object[] arguments, SignatureStruct& sig,
MethodAttributes methodAttributes, RuntimeType typeOwner) at
System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method,
Object target, Object[] arguments, Signature sig, MethodAttributes
methodAttributes, RuntimeType typeOwner) at
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture,
Boolean skipVisibilityChecks) at
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
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) at
Microsoft.VisualStudio.TextTemplatingE78BCB29E8D7A2F9432A449161229C3F.GeneratedTextTransformation.MetadataLoader.TryLoadAllMetadata(String
inputFile, MetadataWorkspace& metadataWorkspace) at
Microsoft.VisualStudio.TextTemplatingE78BCB29E8D7A2F9432A449161229C3F.GeneratedTextTransformation.TransformText()
at
Microsoft.VisualStudio.TextTemplating.TransformationRunner.RunTransformation(TemplateProcessingSession
session, String source, ITextTemplatingEngineHost host, String&
result) 1 1
Clearly its a case of PEBKAC. I hadn’t created my edmx file. Once I had done this all I needed to do was right click on the model. Select “Add Code Generation item”.