zoukankan      html  css  js  c++  java
  • 调试EF源代码环境配置

    1. 下载EF6的源代码,运行build编译,Nuget会自动下载所需的DLL.
    2. 打开EF的工程,可以在EF解决方案下直接新建调试用的项目代码
    3. 添加EF引用时选择解决方案中的Entity Framework项目和SQLServer项目
    4. 修改配置文件
      1. 需要指定System.Data.SqlClient所在的Provide程序集,也就是在EntityFramework.SqlServer项目中
      2. 需要添加entityFramework Section定义

      3. 数据库配置信息
      4.  1 <configuration>
         2   <configSections>
         3     <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=64024bf7194bbc38" requirePermission="false" />
         4   </configSections>
         5   <startup>
         6     <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
         7   </startup>
         8   <connectionStrings>
         9     <add name="db" connectionString="Data Source=(localdb)v11.0;Initial Catalog=School;Integrated Security=True;Connect Timeout=15;Encrypt=False;TrustServerCertificate=False" providerName="System.Data.SqlClient" />
        10   </connectionStrings>
        11   <entityFramework>
        12     <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
        13       <parameters>
        14         <parameter value="v11.0" />
        15       </parameters>
        16     </defaultConnectionFactory>
        17     <providers>
        18       <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
        19     </providers>
        20   </entityFramework>
        21 </configuration>
        View Code
    5. 如果提示强命名验证失败的话,修改EF和EF.SQLServer生产使用的签名SNK,重新强命名。
    6. 如果提示找不到EF程序集,请确认配置文件中DLL的PublicKeyToken是否正确。可以使用SN.exe.查看PublicKeyToken值
  • 相关阅读:
    codeforces 1257 E、F
    hdu5954
    Codeforces Round #597 (Div. 2)
    最长公共子序列
    Codeforces Problem
    Vim 编译运行gcc、g++
    【Codeforces Round #107 (Div. 2)】Win or Freeze
    【Codeforces Round #107 (Div. 2)】Quantity of Strings
    【CoreForces Round #104D】Lucky Number 2
    【CoreForces Round #104C】Lucky Conversion
  • 原文地址:https://www.cnblogs.com/zhangliming/p/4618339.html
Copyright © 2011-2022 走看看