none
Entity Framework 5.0 and DbContext error RRS feed

  • Question

  • I have (re-)installed VS2010 and have been using Entity Framework for a Model-first development project. I have been trying to switch the project over to DbContext, however as soon as I add the DbContext 5.0 generator to my model canvas (Right-click -> Add Code Generation Item), I get the following error when I try to build (see below). I am running VS 2010 version v10.0.40129.1 SP1 Rel, with .NET Framework v4.0.30319.SP1Rel under Windows 7 64-bit (C#).

    Error 1 Running transformation: System.Runtime.InteropServices.COMException (0xE0434352): Exception from HRESULT: 0xE0434352

    Server stack trace: 
       at EnvDTE.ProjectItems.AddFromFile(String FileName)
       at Microsoft.VisualStudio.TextTemplating00DD26FC42EBF7022EFE15B490D4535C.GeneratedTextTransformation.EntityFrameworkTemplateFileManager.VsEntityFrameworkTemplateFileManager.ProjectSync(ProjectItem templateProjectItem, IEnumerable`1 keepFileNames)
       at Microsoft.VisualStudio.TextTemplating00DD26FC42EBF7022EFE15B490D4535C.GeneratedTextTransformation.EntityFrameworkTemplateFileManager.VsEntityFrameworkTemplateFileManager.<.ctor>b__5b(IEnumerable`1 keepFileNames)
       at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
       at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)

    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
       at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
       at System.Action`1.EndInvoke(IAsyncResult result)
       at Microsoft.VisualStudio.TextTemplating00DD26FC42EBF7022EFE15B490D4535C.GeneratedTextTransformation.EntityFrameworkTemplateFileManager.VsEntityFrameworkTemplateFileManager.Process(Boolean split)
       at Microsoft.VisualStudio.TextTemplating00DD26FC42EBF7022EFE15B490D4535C.GeneratedTextTransformation.TransformText()
       at Microsoft.VisualStudio.TextTemplating.TransformationRunner.RunTransformation(TemplateProcessingSession session, String source, ITextTemplatingEngineHost host, String& result) 1 1

    • Moved by CoolDadTx Tuesday, October 2, 2012 9:34 PM EF related (From:Visual C# IDE)
    Tuesday, October 2, 2012 7:18 PM

Answers

All replies

  • Hello,

    I do not know anything about that specific error, but I had some unexplainable errors too when working with model first in EF 4.0 with VS 2010. This was one of the reasons I threw away all the visual designer stuff and I am now working with code first, which works much better.

    Regards
    daProgramma

    Thursday, October 4, 2012 6:22 AM
  • It didn't seem to be as much about the model, because I tried with a blank model and new project before laying down any entities as well. Either the NuGet package didn't grab everything, or perhaps VS2010 is missing a registry entry, or something like that. The error doesn't seem to say what file or string it's missing.

    Fred Barrett

    Thursday, October 4, 2012 2:35 PM
  • Hi FredBarrett,

    In my opinion, the Visual Studio installed on your side is corrupt. You can create an issue on this site: http://entityframework.codeplex.com/workitem/list/basic

    Good day.


    Alexander Sun [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by Alexander Sun Tuesday, October 23, 2012 8:14 AM
    Monday, October 8, 2012 2:35 AM