gpt4 book ai didi

c# - 使用 Windows 安装程序部署 Web 应用程序期间出错

转载 作者:太空宇宙 更新时间:2023-11-03 15:09:44 26 4
gpt4 key购买 nike

我已经使用 windows 安装程序制作了 Web 应用程序安装包,这个包在 IIS 中托管应用程序并在 sql server 上安装数据库。它以前工作正常,但突然出现以下错误,数据库未部署在 Sql 服务器上,但 IIS 部署成功。我在日志文件中收到以下错误

20.01.2017 13:41:53 System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SqlServer.BatchParser, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.SqlServer.BatchParser, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type) at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase) at System.Reflection.Assembly.GetType(String name, Boolean throwOnError) at Microsoft.SqlServer.Management.Common.ServerConnection.GetStatements(String query, ExecutionTypes executionType, Int32& statementsToReverse) at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType) at UpdatingWebconfig.Installer1.ExecuteSqlsecond(String strScript, String serverName, String dbName, String userName, String password) WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

最佳答案

这里有一个可能的解决方案:

might be the SQL Server is 32bit and the Windows is 64bit.

Because of your Windows is 64bit, when the 64bit application started, it will call the assembly of 64bit, but the SQL Server Installation is 32bit and the 64bit assembly might be not included, so you should make sure that you have both Microsoft.SQLServer.BatchParser of 32bit and 64bit. You could confirm this by following steps:

  1. Open C:\Windows\assembly

  2. Find Microsoft.SQLServer.BatchParser, there should be two.

  3. Right-click on them, make sure that one of them is AMD64 and another is X86.

If you couldn’t find the Microsoft.SQLServer.BatchParser of 64bit, please download and install Microsoft SQL Server 2008 R2 Shared Management Objects, because of the Microsoft.SqlServer.BatchParser assembly is included in Microsoft SQL Server SMO.

引用:link

希望对您有所帮助!

关于c# - 使用 Windows 安装程序部署 Web 应用程序期间出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41764323/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com