KevM / tikaondotnet

Use the Java Tika text extraction library on the .NET platform
http://kevm.github.io/tikaondotnet/
Apache License 2.0
195 stars 73 forks source link

Method not found: 'Void System.IO.FileStream #141

Closed jannable closed 4 years ago

jannable commented 4 years ago

Just did a basic Nuget as instructed and followed the examples on the readme but get the following error. Didn't see any obvious solution when browsing. File definitely exists. I get the error when I use the google.com example too.

Unhandled exception. TikaOnDotNet.TextExtraction.TextExtractionException: Extraction failed. ---> System.MissingMethodException: Method not found: 'Void System.IO.FileStream..ctor(System.String, System.IO.FileMode, System.Security.AccessControl.FileSystemRights, System.IO.FileShare, Int32, System.IO.FileOptions)'. at Java_java_io_FileDescriptor.open(String name, FileMode fileMode, FileAccess fileAccess) at java.io.FileDescriptor.open(String , FileMode , FileAccess ) at java.io.FileDescriptor.open(String , Int32 , Int32 ) at java.io.FileDescriptor.openReadOnly(String ) at Java_java_io_RandomAccessFile.open0(Object _this, String name, Int32 mode, FileDescriptor fd, Int32 O_RDWR) at java.io.RandomAccessFile.open0(String , Int32 ) at java.io.RandomAccessFile.open(String , Int32 ) at java.io.RandomAccessFile..ctor(File file, String mode) at java.util.zip.ZipFile..ctor(File file, Int32 mode, Charset charset) at java.util.zip.ZipFile..ctor(File file, Int32 mode) at java.util.jar.JarFile..ctor(File file, Boolean verify, Int32 mode) at java.util.jar.JarFile..ctor(String name) at IKVM.NativeCode.ikvm.runtime.AssemblyClassLoader.lazyDefinePackages(ClassLoader _this) at ikvm.runtime.AssemblyClassLoader.lazyDefinePackages() at ikvm.runtime.AssemblyClassLoader.lazyDefinePackagesCheck() at ikvm.runtime.AssemblyClassLoader.getPackage(String name) at java.lang.Package.getPackage(Class ) at java.lang.Class.getPackage() at org.apache.tika.mime.MimeTypesFactory.create(String coreFilePath, String extensionFilePath, ClassLoader classLoader) at org.apache.tika.mime.MimeTypes.getDefaultMimeTypes(ClassLoader classLoader) at org.apache.tika.config.TikaConfig.getDefaultMimeTypes(ClassLoader ) at org.apache.tika.config.TikaConfig..ctor() at org.apache.tika.config.TikaConfig.getDefaultConfig() at org.apache.tika.parser.AutoDetectParser..ctor() at TikaOnDotNet.TextExtraction.Stream.StreamTextExtractor.Extract(Func2 streamFactory, Stream outputStream) --- End of inner exception stack trace --- at TikaOnDotNet.TextExtraction.Stream.StreamTextExtractor.Extract(Func2 streamFactory, Stream outputStream) at TikaOnDotNet.TextExtraction.TextExtractor.Extract[TExtractionResult](Func2 streamFactory, Func3 extractionResultAssembler) at TikaOnDotNet.TextExtraction.TextExtractor.Extract[TExtractionResult](Uri uri, Func`3 extractionResultAssembler) at TikaOnDotNet.TextExtraction.TextExtractor.Extract(Uri uri)

jannable commented 4 years ago

Nevermind. Missed the fact that the project had to be created as a .NET Framework project and not a .NET Core project.