Visual Studio 2015 Update 2 breaks EF reverse code engineer vsix

左心房为你撑大大i 提交于 2019-11-29 01:25:35

New one for VS2015: https://onedrive.live.com/?authkey=%21AP6uv8OLvM5qnmU&cid=FFD7F3DFCD5E1160&id=FFD7F3DFCD5E1160%2161967&parId=FFD7F3DFCD5E1160%2161965&action=locate

After the update 2: Right click on the project in Solution Explorer > Properties > Target Framework switch back to 4.5.1 and then rebuild the solution. Run now the reverse engineering tool. On my one worked properly

Setting the project as startup project helped me get around this error.

I'm not really sure my case match 100% your but the error is the same and the precondition too.

My original "sin" was the file configured for the CodeAnalysis was missing, so first step is "Check in the Project Properties, at the Code analysis tab if you are using an existing file".

Now the first Exception disappeared but a new one has popped out, a really unexpected OutOfMemoryException!

Taking the devenv.exe process under control I noticed it start consuming RAM very quickly (from 250MB to 2GB in less than 1 sec!) at this point, with no scientific reasons :-), I tried creating a new Empty Ruleset and associating it to the Project and it incredibly started working again!!

I hope this can help you.

judek

Looks like the EF6 Power Tools needs some love from somebody. It is well documented one has to change the .vsix zip packet before it will install into VS2015.

It really feels like this has significant stability issues. After lots of variations on a theme, doing the following, pushes the tool into repeatable issues ...

  1. start new proj. and set target framework to 4.5.1
  2. add a app.config
  3. Install-Package entityframework -ProjectName MYPROJ
  4. [RIGHT-CLICK][Entity Framework][Reverse Engineer Code First (RECF)]
  5. Choose and connection and database This works repeatable with no issues, and kickout (RECF) again and agian at this stage repeatably works.

  6. [RIGHT-CLICK][Entity Framework][Customise Reverse Engineer Templates] and add in the .t files. Repeating the step 4 RECF works repeatably.

  7. Now changing the context.tt in very simple e.g. simply adding a // comment

to the top of context.tt causes the step 4 RECF procedure to consistently fail. Restarting VS2015 and rebooting the box, still does not enable the step 4-RECF to work again.

Deleting the project and starting again, seems to enable the RECF process to work, BUT as soon as I import the tt's and then make a change to a .tt, then there is spiral of different issues in the output ...

either

Insufficient memory to continue the execution of the program #

OR

An exception was thrown while trying to compile the transformation code

OR

One or more errors occurred while processing template 'Entity.tt'. error : An exception was thrown while trying to compile the transformation code. The following Exception was thrown: System.ArgumentException: Empty path name is not legal.

At this resource,
https://visualstudiogallery.msdn.microsoft.com/72a60b14-1581-4b9b-89f2-846072eff19d, there are people commenting various similar issues, but overall I this tool unstable, unreliable and difficult to use in stable repeatable way.

Edit your .Net Framework to 4.5, To do Right Click on Project> Properties > Target Framework. Now try 'Reverse Engineer CodeFirst'.

The problem is that the tool does't automatically download the Entity Framework package, which breaks the rules in the default Code Analysis rule set. So the workaround is first to manually install the Entity Framework package and after that to run Reverse Engineer Code Generator.

For me, it was as simple as another re-start of visual studio.

In my case I have updated entity framework from 4.5 to 4.6, 4.5.1 was not working. Follow following steps to fix this issue.

Right click on the project in Solution Explorer > Properties > Target Framework switch to 4.5 to 4.6 and then rebuild the solution.

Just open Properties tab of your project and remain it opened while running "Reverse Engineering Code First". I don't know why exactly, but it works.

Facing "Out of Memory" exception, try to temporary unload all unrelated projects in the solution. For complex databases encapsulate all your EF-related code to separate project and attach this project to separate solution, then use created solution when you need to run "reverse engineering code first".

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!