[英]Microsoft.Data.Entity.Design, Version=10.0.0.0 is for Visual Studio Developer Preview 11
I am trying something here but keep failing. 我在这里尝试一些东西,但一直失败。
I have Visual Studio Developer Preview installed on a Windows Server 2008 R2. 我在Windows Server 2008 R2上安装了Visual Studio Developer Preview。 As you know, for now VS extensions are not compatible with VS 11 Dev Preview but I found a workaround:
如您所知,目前VS扩展与VS 11 Dev Preview不兼容,但是我找到了一种解决方法:
Visual Studio Extensions and Visual Studio 11 Dev. Visual Studio扩展和Visual Studio 11开发。 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: 我在VS 11上安装了ADO.NET C#DbContext Generator ,但是当我尝试运行代码生成时,出现以下错误:
Error: this template attempted to load component assembly 'Microsoft.Data.Entity.Design, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
错误:此模板尝试加载组件装配'Microsoft.Data.Entity.Design,版本= 10.0.0.0,文化=中性,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. 我从添加参考页面检查过,没有上面的dll。
Any chance I can get this work with VS 11 Dev. 我有机会通过VS 11 Dev进行这项工作。 Preview?
预习?
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 . 解压缩扩展名时,导航至其中的
T/code/
文件夹,其中有一个名为DbContextCS.zip的zip文件。 Unzip that as well, and you will see file called ADONETArtifactGenerator_DbContextCSharp.vstemplate 也将其解压缩,您将看到名为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. 将所有内容打包在一起并安装扩展,当您运行代码生成时,将没有问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.