2
votes

I have made the Web application setup package using windows installer, This package hosts application in IIS and Install Database on sql server. It was working fine previously but suddenly i am getting following error and database not deploying on Sql server but IIS Deployment was successful. I am getting following error in Log File

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].

1

1 Answers

0
votes

Here you have a possible solution:

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.

reference: link

Hope this help!