This seems like it should be a simple solution, but I don’t seem to be getting anywhere with it. I am using Linq to SQL, and in my main application I have defined a class called EventArgs that holds links to three tables among other things.
I am using this class from a plugin that references the main project. It has worked fine up until now, but when I added the third table, I started getting this error. The code is below:
results.BinaryTable.file = File.ReadAllBytes(Path);
results.BinaryTable.lprocessed = !isInvalid;
results.BinaryTable.type = "CAD_V";
The problem is with the first line (Which references a VarBinary(MAX)). If I comment it out, everything works properly. However, when trying to assign it a value, I get the error, “The type ‘System.Data.Linq.Binary’ is defined in an assembly that is not referenced. I tried adding a reference, but System.Data does not have a Linq library, and just adding System.Data does not solve the problem.
I have since changed the ‘file’ type to image and reloaded the DataContext, but the Type in properties is still binary, and I still get the same error. I know I need to make a reference, but I’m not sure where I get that reference. Any help would be greatly appreciated.
System.Data.Linq.Binary is in the dll System.Data.Linq.dll (not System.Data.dll)
Make sure you have a reference to the assembly
See:
http://msdn.microsoft.com/en-us/library/system.data.linq.binary.aspx