.net 无法在使用Windows 8.1/Visual Studio 2013生成的程序中加载Windows Server 2003中的程序集

.net 无法在使用Windows 8.1/Visual Studio 2013生成的程序中加载Windows Server 2003中的程序集,.net,sql-server,visual-studio,.net,Sql Server,Visual Studio,我有一个程序可以在我的开发PC上运行,但不能在我想要运行它的服务器上运行。当我在服务器上运行程序时,出现以下错误: 无法加载文件或程序集“Microsoft.SqlServer.ConnectionInfo”, 版本=11.0.0.0,区域性=中性,PublicKeyToken=89845dcd8080cc91'或 它的一个依赖项。系统找不到指定的文件 我的开发PC是Windows 8.1,带有Visual Studio 2013和SQL Server 2012开发工具。服务器是Windows

我有一个程序可以在我的开发PC上运行,但不能在我想要运行它的服务器上运行。当我在服务器上运行程序时,出现以下错误:

无法加载文件或程序集“Microsoft.SqlServer.ConnectionInfo”, 版本=11.0.0.0,区域性=中性,PublicKeyToken=89845dcd8080cc91'或 它的一个依赖项。系统找不到指定的文件

我的开发PC是Windows 8.1,带有Visual Studio 2013和SQL Server 2012开发工具。服务器是Windows server 2003 R2,标准版,运行.NET 4的Service Pack 2

我首先尝试为服务器找不到的每个程序集将Copy Local设置为true。然后我最终得到了一个程序集的错误,我没有在我的程序中显式引用,所以我想我可能是以错误的方式进行的

消息:无法加载文件或程序集 'Microsoft.SqlServer.SqlClrProvider,版本=11.0.0.0, 区域性=中性,PublicKeyToken=89845dcd8080cc91'或其 依赖关系。系统找不到指定的文件。StackTrace:
在 Microsoft.SqlServer.Management.Common.ConnectionManager.CallerHavePermissionToUseSQLCLR() 在 Microsoft.SqlServer.Management.Common.ConnectionManager..ctor(SqlConnection sqlConnectionObject)位于 Microsoft.SqlServer.Management.Common.ServerConnection..ctor(SqlConnection sqlConnection)

我在程序中使用的程序集可以从安装,但这些2012软件包与Windows Server 2003不兼容。我设法在Win Server 2003上安装的最新程序集来自,这使我在服务器上的程序集版本达到10。当我尝试在Windows 8.1开发PC上安装这些软件时,出现以下错误:

安装Microsoft SQL Server 2008 R2管理对象失败 因为计算机上已存在更高版本。继续, 卸载更高版本,然后运行Microsoft SQL Server 2008 R2 再次设置管理对象


我不喜欢在我的开发机器上从2012年倒退到2008年的程序集,我必须同时支持SQLServer2005和2012。有什么方法可以让Visual Studio 2013瞄准这些较旧的程序集版本吗?

更改程序集版本是我需要做的。通过创建app.config文件并添加以下内容,可以在Visual Studio中指定不同的程序集版本:

<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.SqlServer.ConnectionInfo"
                          publicKeyToken="89845dcd8080cc91" />
        <bindingRedirect oldVersion="11.0.0.0"
                         newVersion="10.0.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>