Hi,
I'm trying to index a physical file in my computer as specified in http://find.episerver.com/Documentation/dotnet-api-attachments using the below code:
var document = new Document() { Name = fd.Name, Attachment = newFileAttachment(filePath) };
var result = client.Index(document, x => x.Id = fd.Id);
The document in the filePath is a pdf of size 6.5 MB. When I code executed the client.Index, I get an error - "Exception has been thrown by the target of an invocation. [Exception of type 'System.OutOfMemoryException' was thrown.]". Kindly let me know what is the reason for this and what can be done to avoid this error.