views:

89

answers:

1

I have a really tricky thing going up here. My project has around 100 tables and they are all mapped by LINQ. Everything works fine in a dev and test environment. These enviroments are MS Win 2008 r2 servers with SQL 2008 sp1 databases. IIS and SQL are on a different machines. Now on production enviroment which is MS Win 2003 x64 web farm + geoclustered SQL 2008 IT DOES not work. All I get is the exception

System.IndexOutOfRangeException: Index was outside the bounds of the array. at
System.Data.Linq.IdentityManager.StandardIdentityManager.MultiKeyManager3.TryCreateKeyFr>om    Values(Object[] values, MultiKey& k) at   
System.Data.Linq.IdentityManager.StandardIdentityManager.IdentityCache2.Find(Object[]   
keyValues)  
at System.Data.Linq.ChangeProcessor.GetOtherItem(MetaAssociation assoc, Object instance) at System.Data.Linq.ChangeProcessor.BuildEdgeMaps() at  
System.Data.Linq.ChangeProcessor.SubmitChanges(ConflictMode failureMode) at   
System.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode) at   
ERS.IIMP.Services.ExposuresSrv.Update(Int32 ExpID, Int32 AssID)     
Services\ExposuresSrv.cs`

My question is What the hell. They have precisely the same DBML, the DB has exactly THE SAME structure (when I get the DB from prod to TEST and mount it eveything works just great), the binaries on the WEB Server are the same. I seriously do not know what to do.... Did anyone found that Linq works on one env and does not on the second?? I mam really lost here. I really hope You can help me:)

+1  A: 

Is it possible your Windows 2003 web farm is using .NET 3.5 without SP1 and your dev machines have SP1?

There were a number of bugs around foreign keys mapping to fields at the other end that were not primary keys - some were fixed in .NET 3.5 SP1 and a few in .NET 4.0.

This would be exactly in that code path and the result is often an index out of range (or an invalid cast).

DamienG