Metadata file not found - Data.Entity.Model
Asked Answered
R

9

16

Anyone having similar problem, while creating webservices?

Compiling transformation: Metadata file 'D:\Program Files\VS2013\Common7\Tools..\IDE\Microsoft.Data.Entity.Design.dll' could not be found D:\PROJEKTY\apki\ws2\WS\WS\DataModel.tt

error screenshot

I tried adding data model again, restarting VS, cleaning and building solution, creating new project, deleting and adding reference, installing the newest version. I think that any solution found on internet does not work for me.

Any suggestions? I think of pasting file into this directory, but can't think what may be there.

Razor answered 29/10, 2013 at 17:10 Comment(9)
It seems like you don't the EF Designer installed. Go to "Programs and Features", click "Microsoft Visual Studio 2013" -> Change and make sure that Microsoft Web Developer Tools is checked (I remember that there was Sql Data Tools or something like that that would install the designer too). You seem to have installed VS in custom location do you by any chance have the "c:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE" folder too which does contain the missing file?Partiality
Unfortunately, I have Web Dev Tools installed, SQL Server 2012 as well. I don't have this file in location you suggested. I do have files from Data.Entity in my custom VS location and one of them, Design.Extensibility seem to be referenced properly in the project. I tried copying missing .dll to some locations at the project but it didn't work. Location of it is: D:\Program Files\Visual Studio 13\Common7\IDE\ I also tried changes in connectionstring: metadata=res://*/|res://*/|res://*/;provider= I'll try hard reference, but I'm afraid that the location needed by DataModel.tt is hardcoded.Razor
Yeah, hard reference didn't work : /Razor
I also pasted missing file to D:\Program Files\VS2013\Common7\Tools\IDE but it didn't work... //sorry for multipostingRazor
So, where was the missing dll placed (i.e. the place you are copying it from)? To me it seems that your installation might be broken as you don't seem to have all the required files in the right place. The file should be in something like "c:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE" folder. It is being referenced from ttinclude files as follows: <#@ assembly name="%VS120COMNTOOLS%..\IDE\Microsoft.Data.Entity.Design.dll" #>. If your the VS120COMNTOOLS variable points to wrong folder things will not workPartiality
The thing that is not clear to me is that the error message points to: 'D:\Program Files\VS2013\Common7\Tools..\IDE\Microsoft.Data.Entity.Design.dll' which would mean that the VS120COMNTOOLS variable points to D:\Program Files\VS2013\Common7\Tools while in a message above you are mentioning D:\Program Files\Visual Studio 13\Common7\IDE`. I don't know if VS2013` vs. Visual Studio 13 was a typo but if not this can be a source of the problem.Partiality
Seems like custom installation folder was not a good idea. Anyway I tried pasting missing file in multiple locations like D:\Program Files\VS2013\Common7\IDE\Tools\IDE, D:\Program Files\VS2013\Common7\Tools or D:\Program Files\VS2013\Common7\Tools\IDE and it does not work either. I'll try reinstallation of VS2013 to standard location. Thank you for your help! Dzięki!(?) ;)Razor
It might be a bug in the installer. I will create a work item to verify that tooling works correctly if installed in a non-default location. Nie ma za co! ;) entityframework.codeplex.com/workitem/1782Partiality
After seeing this: #19791778 I have a feeling that this is a legitimate bug somewhere in the EF Designer/VS but we were unable to repro it so far.Partiality
G
26

Based on

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes\EF6.Utility.CS.ttinclude

, the code generator is looking for the missing DLLs in the following locations:

<#@ assembly name="%VS120COMNTOOLS%..\IDE\EntityFramework.dll" #>
<#@ assembly name="%VS120COMNTOOLS%..\IDE\Microsoft.Data.Entity.Design.dll" #>

I discovered that the environment variable %VS120COMNTOOLS% is not compatible with the correct installation path of visual studio, so I changed it from Advanced system properties and it worked

Gilliette answered 17/12, 2013 at 0:54 Comment(5)
Where can you find these "advanced system properties"? I'd like to see if this fix applies to my problem. Thanks.Presumptuous
Sorry @LouisSherwood for the delay. You can modify "Environment Variables" from the button at the bottom of "Advanced" tab of your Windows "System Properties" dialog. Check this imageGilliette
Worked for me with Visual Studio 2013 Professional. Mine was pointing to C:\Program Files (x86)\Common7\Tools when the correct directory (for me) was C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\ToolsFalconet
Yea, looks like my non-default install of VS to another drive cost me the same issue. Just had to update the var, restart VS, and it started working. Thanks!Interlocutress
This finally fixed it for me, I initially installed VS in D:\, and by changing it to my C: it fixed my problems!Rebecarebecca
N
6
  1. Check your install location. I installed VS to the other location D:\ than default C:\ so I got the error.
  2. modify "Environment Variables" to your location, for me it means changing C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\ to D:\Microsoft Visual Studio 12.0\Common7\Tools\.
  3. DON'T Forget to add a \ to the end of word.
Nod answered 20/3, 2015 at 7:44 Comment(0)
P
4

I believe VS is not updating the VS120COMNTOOLS variable correctly when reinstalling VS to a different drive. See this SO thread for an extended answer.

Partiality answered 11/11, 2013 at 18:10 Comment(0)
F
1

The problem lies in the fact that the file originally EF6.Utility.CS.ttinclude wrong. Even if the variable %VS120COMNTOOLS% is the correct value, the error still occurs.

Blame the two stupid points in the following lines (%VS120COMNTOOLS%..\IDE):

<#@ assembly name="%VS120COMNTOOLS%..\IDE\EntityFramework.dll" #>
<#@ assembly name="%VS120COMNTOOLS%..\IDE\Microsoft.Data.Entity.Design.dll" #>

If that's the way to fix the error no longer occurs:

<#@ assembly name="%VS120COMNTOOLS%\IDE\EntityFramework.dll" #>
<#@ assembly name="%VS120COMNTOOLS%\IDE\Microsoft.Data.Entity.Design.dll" #>

And the variable %VS120COMNTOOLS% must have the correct value, of course.

The question is old, but the answer is still relevant now, because this error persists, and in the VS2015. Below lines from the ill-fated file:

<#@ assembly name="%VS140COMNTOOLS%..\IDE\EntityFramework.dll" #>
<#@ assembly name="%VS140COMNTOOLS%..\IDE\Microsoft.Data.Entity.Design.dll" #>

Sorry.

Fatness answered 2/2, 2016 at 22:38 Comment(0)
V
1

Not sure why this is happening. One of my colleague faced this issue when he is trying to generate database from Model in a common server that we are using. I tried in the same machine with my login from my PC and it worked for first time and i tried again and i got the same error. I just did a

devenv /resetsetting

in VS 2013 command prompt and it worked. Did the same in my colleagues machine and it worked too. Not sure it will workbut wort a try

Viperine answered 19/2, 2016 at 10:57 Comment(1)
After I fix the wrong environment variables, this command works.Roughage
R
0

This worked for me.

  1. Go to C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes\EF6.Utility.CS.ttinclude

  2. Edit it with Visual Studio.

  3. Remove the two dots after the URL, so the new lines like:

    <#@ assembly name="%VS120COMNTOOLS%\IDE\EntityFramework.dll" #>
    <#@ assembly name="%VS120COMNTOOLS%\IDE\Microsoft.Data.Entity.Design.dll" #>
    
  4. Fix your environment variables to end with directory just befor IDE. In my case

    C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\
    
  5. Rebuild the project or delete the entity framework and recreate it.

Ruel answered 19/2, 2018 at 12:47 Comment(0)
S
0

Good day guys, Ive encountered this error in the app im working on what I did was: 1. revert the solution/module where the entities, 2. Remove the %VS110COMN% so the code will look like this

<#@ assembly name="..\IDE\EntityFramework.dll" #>
<#@ assembly name="..\IDE\Microsoft.Data.Entity.Design.dll" #>
Stepheniestephens answered 12/11, 2019 at 7:34 Comment(0)
A
0

I know this is late to respond to the question but.

This work For me by following the below steps.

  1. Copy the code form the existing abc.tt file.
  2. Delete the abc.tt file.
  3. Copy all the code again into ABC.tt file.

After copy code just save the file and build the solution it will regenerate the complete .cs file as well.

Asper answered 23/4, 2020 at 6:59 Comment(0)
B
-1

Try this:

  1. Double Click on the .edmx Model
  2. Right click anywhere on the "Entity Data Model Designer"
  3. Click "Update Model from Database"
  4. Click Finish
Bellows answered 29/12, 2014 at 18:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.