June 9, 2009 at 5:45 am
Hi,
I have written a C#.net service that connects to a FTP server and downloads *.SQL files and applies these upgrades to a SQL Server DB. It runs fine and works on my version of SQL Server 2005. It uses the SQL Server 2005 SMO classes and uses execute non query to process the .sql files. I have developed this using SQL Server 2005.
The issue I have is I have installed this service onto the Clients server which is running SQL Server 2008. When trying to execute the .sql file it throws an error:
Could not load file or assembly Microsoft.Sql.Server.BatchParser, version 9.0.242.0, culture = neutral, public token 2121544848484... blah...An attempt was made to load a program with an incorrect format.
As my service executes the .sql files totally fine on my SQL Server 2005, I can only assume that the related Microsoft.Sql.Server.BatchParser that ships with my service is not compatiable with SQL Server 2008.
Does anyone know how I would obtain the 2008 version dll to perhaps overcome this issue. I have read posts regarding a similar error between 2000 and 2005 but I couldnt find a related answer that assisted.
Will keep searching, any help is appreciated... 🙂
Perhaps I need to load the .Net lib for SQL Server 2008 SMO into my C#.Net developement environment to access the correct version of dll, once this is done then tests it on SQL Server 2005 and 2008 to make sure the service works with both versions ...??
June 9, 2009 at 10:19 am
I believe that the SMO-related stuff gets installed along with the corresponding SQL Client tools. You customer situation can probably be fixed by installing the SQL Server 2005 Client Tools on their server.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 9, 2009 at 4:58 pm
Dont know if this is correct as I have installed SQL 2005 client tools on my work pc and when doing a search for the Microsoft.Sql.Server.BatchParser.dll. It does not exist. I think the issue is more with the fact that my service is attempting to execute the dll aganist SQL Server 2008 DB but its not compatible with 2008 as its a 2005 dll...?? dont know...
Looking into this link below, perhaps this is the issue....
http://petesbloggerama.blogspot.com/2007/12/windows-server-2008-x64-could-not-load.html
June 11, 2009 at 1:18 am
I also have the same problem.
though I still didn't really fix the problem, this is what I found out:
BatchParser.dll is installed together with the SMO package and you can find it in the Windows\assembly folder.
I am getting the error when using my product on a machine without SMO or SQL installed. I tried to copy all the dll's from DEV environment to that machine but it didn't resolve the issue. It seems like you must add the DLL to GAC but when using GacUtil i am getting an error.
The problem is I can't ask the customer to install any package on the machine.
Please help...
June 11, 2009 at 5:06 am
This link explains alot.. im in the process of trying to upgrade to SMO version 10 to overcome my issue on 2008.
June 11, 2009 at 5:36 pm
OK, success!!!
In order to make my service compatiable between SQL Server 2008 and 2005 and to stop the errors with Batch Parser and Connection version 10 of SMO is the answer.
My dev environment is C#.Net 2008 VS and MS SQL Server 2005, but the client is running SQL Server 2008... in order to overcome this issue I had to install the 2008 SMO installers, see:
install in this order;
1) Microsoft SQL Server System CLR Types
2) Microsoft SQL Server 2008 Management Objects
3) Microsoft SQL Server 2008 Native Client
Also make sure your windows installer is on version 4.5.
I had to goto into my service application and remove the version 9 SMO references then reference the version 10 libs, recompile my app and then the installer. I re-ran the install process on the clients SQL 2008 server, Worked fine. I then re-ran the intall process on my production SQL 2005 server and also worked.
Shane
June 11, 2009 at 10:30 pm
Thank you very much shane
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply