Sicos1977 / IFilterTextReader

A reader that gets text from different file formats through the IFilter interface
Other
55 stars 38 forks source link

Docx, pptx issues with console application #5

Closed daemon025 closed 9 years ago

daemon025 commented 9 years ago

I'm trying to use FilterReader in console application and it fails to read docx, pptx files. It fails on this line: var registryKey = Registry.LocalMachine.OpenSubKey(key); I suppose it may be something with static main method. Some of the code: public class Test { private readonly Job _job = new Job(); public Test() { _job.AddProcess(Process.GetCurrentProcess().Handle); }

    public void Search()
    {
            using (var reader = new FilterReader("D:\\test2.docx",string.Empty))
            {
                  Console.WriteLine(reader.ReadToEnd());
             }
    }

And the main: static void Main(string[] args) { new Test().Search(); }

Is it something wrong with my code or it is a bug? P.S. The windows application is reading everything.

daemon025 commented 9 years ago

Changing platform target from auto to x64 solved the issue