Microsoft.Data.Entity.Design, Version=10.0.0.0 is for Visual Studio Developer Preview 11

做~自己de王妃 提交于 2019-12-09 21:51:03

问题


I am trying something here but keep failing.

I have Visual Studio Developer Preview installed on a Windows Server 2008 R2. As you know, for now VS extensions are not compatible with VS 11 Dev Preview but I found a workaround:

Visual Studio Extensions and Visual Studio 11 Dev. Preview

I installed ADO.NET C# DbContext Generator on VS 11 but when I try to run the code generation, I am getting the following error:

Error: this template attempted to load component assembly 'Microsoft.Data.Entity.Design, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. For more information on this problem and how to enable this template, please see documentation on Customizing Project Templates.

I checked from the add reference page, there is no dll like above.

Any chance I can get this work with VS 11 Dev. Preview?


回答1:


Ok, I solved the problem but I am not sure it is legitimate or not.

when you unzip the extension, navigate to T/code/ folder inside that, there is a zip file called DbContextCS.zip. Unzip that as well, and you will see file called ADONETArtifactGenerator_DbContextCSharp.vstemplate

Open this up with text editor and change this code:

  <WizardExtension>
    <Assembly>Microsoft.Data.Entity.Design, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>
    <FullClassName>Microsoft.Data.Entity.Design.VisualStudio.ModelWizard.AddArtifactGeneratorWizard</FullClassName>
  </WizardExtension>

To this one:

  <WizardExtension>
    <Assembly>Microsoft.Data.Entity.Design, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>
    <FullClassName>Microsoft.Data.Entity.Design.VisualStudio.ModelWizard.AddArtifactGeneratorWizard</FullClassName>
  </WizardExtension>

Pack everything back together and install the extension, when you run the code gen., you will have no problem.



来源:https://stackoverflow.com/questions/8416591/microsoft-data-entity-design-version-10-0-0-0-is-for-visual-studio-developer-pr

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