none
Could not load file or assembly 'Microsoft.SqlServer.BatchParser' or one of its dependencies RRS feed

  • Question

  • I got this problem when I tried to migrate one of my web deployment project from vs2005 to vs2010 on windows 7 machine. The exactly error message is like this:

    Could not load file or assembly 'Microsoft.SqlServer.BatchParser' or one of its dependencies. An attempt was made to load a program with an incorrect format.(description) ASPNETCOMPILER(file), myWebDeploy (project)

    I have installed all of suggested feature packs as suggested by others: SQLServer2005_ADOMD_x64.msi, SQLServer2005_XMO_x64.msi.

    Can somebody please help?

    Thanks a lot 

    Friday, August 20, 2010 9:08 PM

Answers

  • I think I figured out the cause of it. Actually, the problem is on my part. In one of my projects, I am using a dll which is created by somebody else. when it was implemented, the BatchParser.dll was not referenced correctly. So after I migrated my environment to 64 bit, the copied dll could not be loaded. I ended up removed that dll and everything worked fine.

    Thank you for your help.

    • Marked as answer by KJian_ Friday, August 27, 2010 8:29 AM
    Tuesday, August 24, 2010 9:53 PM

All replies

  • 1. what is the target runtime of your application. Is it .Net 4.0?

    2. Your application is using SMO in 2005 right? not DMO.

    3. Ideally , if you target your application to be built against lower .Net version, it should work.

    If you want your application to be targetted in .Net4.0 Runtime, migrate to SMO 2008 R2 and use the following in your config.

    <?xml version="1.0" encoding="utf-8" ?>

    <configuration>

      <startup useLegacyV2RuntimeActivationPolicy="true">

        <supportedRuntime version="v4.0"/>

      </startup>

    </configuration>

    SMO support in .Net 4.0 isnt announced by us yet. This will just work, but it isnt an supported scenario as of now.

     

    • Proposed as answer by mishrsud Monday, May 12, 2014 7:15 AM
    Saturday, August 21, 2010 3:07 PM
  • Thanks, Vindy.

    I downloaded both 2008R2SharedManagementObjectsX64.msi and 2008R2SharedManagementObjectsX86.msi and installed them.

    However, I don't know what config file you were referring. The failure is in the web deployment project (.wdproj). This is the project I am creating to install the webservice.

    Thanks a lot.

    Monday, August 23, 2010 10:14 PM
  • I think I figured out the cause of it. Actually, the problem is on my part. In one of my projects, I am using a dll which is created by somebody else. when it was implemented, the BatchParser.dll was not referenced correctly. So after I migrated my environment to 64 bit, the copied dll could not be loaded. I ended up removed that dll and everything worked fine.

    Thank you for your help.

    • Marked as answer by KJian_ Friday, August 27, 2010 8:29 AM
    Tuesday, August 24, 2010 9:53 PM