Print Page | Close Window

Unable to locate edmx for code generation

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1804
Printed Date: 21-Apr-2026 at 10:39am


Topic: Unable to locate edmx for code generation
Posted By: jmpinchot
Subject: Unable to locate edmx for code generation
Date Posted: 12-May-2010 at 12:24pm
In my project, I'm using a separate model project. Within that separate project, I have three edmx files in sub-folders:

Models\Core\Core.edmx
Models\History\History.edmx
Models\Reporting\Reporting.edmx

When I attempt to run code generation, the edmx.tt files get placed in the root directory (instead of at the same level as the edmx files), and I get the following error:

Running transformation: IdeaBlade.VisualStudio.OM.OMException: Unable to locate file: Core.edmx
   at IdeaBlade.VisualStudio.OM.CodeGenerator.DomainModelTemplate.Generate()
   at Microsoft.VisualStudio.TextTemplating042B1605D3195C70063A125D242888F8.GeneratedTextTransformation.TransformText() in d:\eCustody2_0\Development\Source\eCustody\Data.Web\Core.edmx.tt:line 16
   at Microsoft.VisualStudio.TextTemplating.TransformationRunner.RunTransformation(TemplateProcessingSession session, String source, ITextTemplatingEngineHost host, String& result) 


Moving the edmx.tt file to the correct subdirectory and attempting to rebuild generates that same error.

If I move the edmx and the edmx.tt files out to the root directory and build everything works fine, but this is really a sub-optimal solution for us because it will involve moving a large number of files around everytime we add a new table, or need to regenerate the code. How can I keep the edmx and edmx.tt files in their proper sub-directory and successfully run the code generator; hopefully keeping the developer class files in the appropriate sub-directories as well?




Replies:
Posted By: ting
Date Posted: 15-May-2010 at 12:08am
Hmm, when I dragged the .edmx and .edmx.tt into the subfolder and ran code generation everything was put in the right place.  Only if I delete the .edmx.tt file did it get regenerated in the wrong location.
 
I have filed a bug/feature request to generate the .edmx.tt file into the same physical location as the .edmx file.
 
Thanks for pointing this out.
 


Posted By: jmpinchot
Date Posted: 26-May-2010 at 11:50am
I've recently come back to this issue, having put it on the back burner since most of our tables aren't mapped yet anyway. But even after dragging both the .edmx and .edmx.tt (as well as the .ReadMe file) into the a sub folder or a sub folder two levels down, this problem persists.

I've even tried to create a second separate model assembly and start from scratch, but haven't gotten it to work properly.


Posted By: ting
Date Posted: 26-May-2010 at 5:39pm
Hmm.  Not sure why we're getting different behavior.
 
However, we have this fixed so that the DevForce files will be generated in the same folder as the edmx.  This will be in the upcoming release scheduled for the week of June 7.
 



Print Page | Close Window