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.

abatishchev
  • 98,240
  • 88
  • 296
  • 433
ignacy130
  • 322
  • 1
  • 2
  • 17
  • 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? – Pawel Oct 29 '13 at 18:43
  • 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. – ignacy130 Oct 29 '13 at 19:33
  • Yeah, hard reference didn't work : / – ignacy130 Oct 29 '13 at 19:42
  • I also pasted missing file to `D:\Program Files\VS2013\Common7\Tools\IDE` but it didn't work... //sorry for multiposting – ignacy130 Oct 29 '13 at 19:51
  • 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 work – Pawel Oct 29 '13 at 19:52
  • 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. – Pawel Oct 29 '13 at 19:55
  • 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!(?) ;) – ignacy130 Oct 29 '13 at 20:05
  • 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! ;) https://entityframework.codeplex.com/workitem/1782 – Pawel Oct 29 '13 at 20:21
  • After seeing this: http://stackoverflow.com/questions/19791278/error-when-generating-databe-from-model-in-visual-studio-2013 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. – Pawel Nov 05 '13 at 18:09

9 Answers9

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

modeeb
  • 431
  • 4
  • 16
  • Where can you find these "advanced system properties"? I'd like to see if this fix applies to my problem. Thanks. – Louis Sherwood Jan 20 '14 at 14:08
  • 2
    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 [image](http://bit.ly/1gMb0fw) – modeeb Feb 05 '14 at 13:42
  • 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\Tools – SeanOB Jun 01 '14 at 07:21
  • 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! – TravisWhidden Jul 17 '15 at 18:10
  • This finally fixed it for me, I initially installed VS in D:\, and by changing it to my C: it fixed my problems! – Zorgarath Feb 04 '16 at 06:52
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.
PatJ
  • 5,996
  • 1
  • 31
  • 37
Jaon
  • 106
  • 1
  • 3
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.

Community
  • 1
  • 1
Pawel
  • 31,342
  • 4
  • 73
  • 104
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.

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

Vivekh
  • 4,141
  • 11
  • 57
  • 102
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.

Pang
  • 9,564
  • 146
  • 81
  • 122
Sulyman
  • 440
  • 5
  • 14
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" #>
Win Del
  • 17
  • 5
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.

Tanmay Nehete
  • 2,138
  • 4
  • 31
  • 42
-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
usefulBee
  • 9,250
  • 10
  • 51
  • 89