I have a project that I am in the process of migrating to using Linq To SQL. On the whole it's fine, but I'm stuck on an issue where if I try to put a timestamp from an DTO into a hidden field I get this error at runtime:
BC30652: Reference required to assembly 'System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' containing the type 'System.Data.Linq.Binary'. Add one to your project.
I definitely have a reference to the assembly, otherwise other sections of the code wouldn't compile. I tried removing all references and deleting the bin and obj folders, but I still get the same error.
It happens on this line in the markup:
<asp:HiddenField ID="hfTimestamp" runat="server"
Value='<%#CType(Container.DataItem, CommunicationType).pslTimestamp.TimestampToString() %>' />
Where TimestampToString is an extension method that looks like this:
<Extension()> _
Public Function TimestampToString(ByVal binary As Binary) As String
Return BitConverter.ToUInt64(binary.ToArray(), 0).ToString()
End Function
Has anyone seen this kind of behavior and know a fix to it?