Pocket PC 2003, SQL Compact Edition, SQL2005, IIS6.0
I implemented a business logic handler to deal with conflicts. When I deploy it on the SQL server which is also the web replication server, the logic handler seems working fine. However, if I deploy this handler to another web server. The logic handler failed to be loaded.
My enviroment settings are desribed as below.
Machine A, distributor, with database and publication. The business logic handler is deployed at C:\Program Files\Microsoft SQL Server\90\COM\BusinessLogicHandler.dll. It's registered by using sp_registercustomresolver. The @.assembly is specified as @.assembly=C:\Program Files\Microsoft SQL Server\90\COM\BusinessLogicHandler.dll';
Machine B, IIS server. The same business logic handler is deployed at C:\Program Files\Microsoft SQL Server\90\COM\BusinessLogicHandler.dll on the Machine B itself.
When I ran the web replication, the Merge Agent reported the error as below.
Error loading custom assembly "C:\Program Files\Microsoft SQL Server\90\COM\BusinessLogicHandler.dll", Error: "Could not load file or assembly 'C:\\Program Files\\Microsoft SQL Server\\90\\COM\\BusinessLogicHandler.dll' or one of its dependencies. The given assembly name or codebase was invalid.
It seemed that the Merge Agent had trouble to find my logic handler because the path reported in the error log has two backward slashes. I have no idea where did that came from. I am not sure if that's the cause of the error. Without business logic handler. I had successfully finished web replication of Machine B to sync with Machine A. If I setup web replication directly on Machine A with business logic handler, I can successfully sync as well.
Does anyone has any idea about how to correctly deploy business logic handler on a web server?
Thanks,
Nigel
It seems that if I sign the dll and install it in the global assembly of Mahine B. The problem went away. Does it mean we should deploy our assembly in the global assembly instead of the path "@.assembly" of distributor when we deploy our business logic handle to a IIS web replication server? The SQL2005 document does not specify how we should deploy the business logic handler for the web synchronization server. It would be nice if it could MS can provide more detail in business logic handler deploymont. However, it still seems to me it's a bug for the Merge Agent not be able to find the business logic handler in my previous post. Still don't know where the backward slashes come from.
If anyone has more details about this issue, please advise.
Thanks,
Nigel
No comments:
Post a Comment