문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top