环境 windows7x64 + vs2010 + sqlite。net + entityFramework现在有一下几个问题1.本机调试运行报 "操作可能会破坏运行时稳定性"的错误   
  我已经把所有的项目属性都改成x86,引用的dll也是x86
   (使用x64也是这样)
   具体报错如下发生了 System.Security.VerificationException
 Message=操作可能会破坏运行时稳定性。
Source=System.Data.SQLite.Linq
 StackTrace:
在 System.Data.SQLite.SqlGenerator.Visit(DbScanExpression e)
 InnerException: sqlite网站提供的testlinq 可以运行,当我去下了它的testlinq的源代码 运行也是报操作可能会破坏运行时稳定性的错误
2.单独运行 生成的 exe时候发现 我用。net代码插入的 guid格式数据,用 navicat lite等工具读就是乱码,设置密码也是不兼容。3. 在其他机器上运行 报找不到 SQLite Provider 的错误
我的配置文件如下

解决方案 »

  1.   

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <configSections>
            <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
            <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        </configSections>
        <entityFramework>
            <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
                <parameters>
                    <parameter value="Data Source=(localdb)\v11.0; Integrated Security=True; MultipleActiveResultSets=True" />
                </parameters>
            </defaultConnectionFactory>
        </entityFramework>
        <system.data>
            <DbProviderFactories>
                <remove invariant="System.Data.SQLite"/>
                <add name="SQLite Data Provider" invariant="System.Data.SQLite"
                     description=".Net Framework Data Provider for SQLite"           type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
            </DbProviderFactories>
        </system.data>    <connectionStrings>
            <add name="CodeLibraryEntities" connectionString="metadata=res://*/CodeLibraryModel.csdl|res://*/CodeLibraryModel.ssdl|res://*/CodeLibraryModel.msl;provider=System.Data.SQLite;provider connection string=&quot;data source=D:\xm\CodeLibrary\CodeLibrary.db&quot;" providerName="System.Data.EntityClient" />
        </connectionStrings>    <startup useLegacyV2RuntimeActivationPolicy="true">
            <supportedRuntime version="v4.0"/>
            <requiredRuntime version="v4.0.20506" />
        </startup>
    </configuration>
      

  2.   

    Win7 X64 + VS2010 + SQL2008 R2 + EF4.3.1表示没有见过此错误。
      

  3.   

    是我的app。config 不对吗?现在 主要的的问题就是 
    1.调试的时候 老是报"操作可能会破坏运行时稳定性"的错误   ,只能编译出来 ,点击运行2.客户机安装的时候找不到SQLite Provider 
      

  4.   

    发生了 System.Security.VerificationException
      Message=操作可能会破坏运行时稳定性。
    Source=System.Data.SQLite.Linq
      StackTrace:
    在 System.Data.SQLite.SqlGenerator.Visit(DbScanExpression e)
      InnerException:  
    这个问题 谁帮帮我啊