"Index was outside the bounds of the array." with v5.2.0.32
Detmar
Posts: 3
We are getting the "Index was outside the bounds of the array." error in the Comparing step when comparing two SQL Server 2005 databases that contain many assemblies (>30).
This problem has already been reported for a previous version according to this forum. I followed the hint to delete all assemblies in the destination database which allowed me at least to compare the other database objects.
All ideas on how to make the compare process work without deleting the assemblies are highly appreciated.
This problem has already been reported for a previous version according to this forum. I followed the hint to delete all assemblies in the destination database which allowed me at least to compare the other database objects.
All ideas on how to make the compare process work without deleting the assemblies are highly appreciated.
Comments
Can you please send one of the assemblies (in .dll form) to support@red-gate.com? If upgrading to version 5.2 didn't sort out the problem, then it must be the issue to do with non-EMCA compliant assemblies that may have been produced in beta versions of Visual Studio.
Okay, but can you please send the assemblies anyway?
Thanks.
I was able to create the assembly and the asymmetric key in a database and migrate the assembly to another database in SQL Compare's synchronization wizard. So I think we can rule out the assembly format.
I don't have a tremendous amount of experience in this area, but is it possible that there are functions or types bound to this assembly that don't exist in the assembly itself? That could explain the index out of bounds.
Is there anything in the sys.assemblies table (select * from sys.assemblies)?
Can you try running DBCC CHECKDB against the database?
I ran the queries against the master database, not our own one :roll:
When I run the query against our database I get the following
and
Can you run ? Does this return NULL?
Are you using the 'Map Owners' button in the comparison settings? Different logic applies to the database object comparison when you substitute ownership this way.
My guess is that there is a problem with an array of objects that are members of SQL Compare's 'Assembly' class. It could be something like an incorrectly-formatted extended property or the inability to access the permissions for the object because you do not have sufficient access to view the permissions, for instance. Let's try the test application first and see if it reveals the problem; if not we can drill deeper into it.
I will see if there is a fix for this.
Can you try dropping the assembly from the database and re-deploying it again to see if that helps?
Unfortunately when I try to run this in SQL 2005 SP 1, I get Note I changed the ownership/schema to dbo, but I don't think this makes a difference?
I have sent the code to your support mailbox.
Still no reproduction on the problem. The assembly slips right into the database after creating schema NBL and user Eureka in two dbs and comparing the two. I have no idea what is going wrong.
Anyway, now we move on to the interesting part. After reading this and other threads, I tried deleting the unsafe threads from the destination and the compare is SUCCESSFUL!!!
We are in the process of recovering a customer facing server and the inability to certify the completeness of the db has had me a bit "concerned". I guess I have come to rely on the SQL Compare tools as a certification method as well as deployment and troubleshooting.
So, deleting the assemblies from the target db seems to have resolved this issue. We had gone through much trouble of setting up asymmetric keys, logins, and users to be able to run .Net assemblies unsafe without having to resort to "trusted" settings at the db level.
Oh, and I was getting the same results ("index was outside the bounds of the array") regardless of the version of SQL Compare (v5 or v6 latest build in trial mode).
I hope this helps someone somewhere.
This seems to be a problem when comparing a 32 bit machine to a 64 bit machine...I can compare 64 instances to each other just fine.
Is there a workaround to this? Is there a way to test the dll components or something?
Thanks