Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I wrote an asp.net web app which uses SMO against SQL Server 2008 to be able to run some DB scripts. It references these assemblies (in the C:Program FilesMicrosoft SQL Server100SDKAssemblies folder):

Microsoft.SqlServer.ConnectionInfo
Microsoft.SqlServer.Management.Sdk.Sfc
Microsoft.SqlServer.Smo

The microsoft.sqlserver.batchparser.dll is not in this folder. Locally (32 bits machine, IIS7) I have no issue.

When I publish the app to my hosting provider (discountasp.net, SQL Server 2008, IIS7, 32bits too), I get this error:

Could not load file or assembly 'Microsoft.SqlServer.BatchParser, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.

I searched my local machine and I can't find this assembly. However it works well on this machine.

The "Microsoft SQL Server 2008 Setup Discovery Report" tool reports I have v10.1.2531.0 installed locally.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
741 views
Welcome To Ask or Share your Answers For Others

1 Answer

To get this dll, you will need to install the Microsoft SQL Server 2008 Management Objects (available from here). That particular dll gets installed into the GAC, which is why you probably cannot find it using a search.

As you are using a hosting provider, it would appear that they do not have this installed. Your choices are to get it installed by them (which is probably unlikely), or deploy the dll manually (which may be on dodgy licencing ground).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...