Open albahari opened 5 years ago
Good idea, I didn't know about them. I'll have a look at updating tesseract in time for the next release.
Added this method to my LINQPad queries to allow InteropDotNet
to find the native assemblies within the temporary folder LINQpad creates upon query execution.
Note that I'm on Windows and am still a beginner so I can't verify if it will work for everyone.
static void CopyTessLibraries(string tessVersion, string platform)
{
var destFolder = Path.Combine(Environment.CurrentDirectory,platform);
Directory.CreateDirectory(destFolder);
var tessNugetFolder = new LINQPad.ObjectModel.NuGetReference("Tesseract")
.GetPackageFolders()
.First(folderName => folderName.Contains($@"Tesseract\{tessVersion}"));
var platformFiles = Directory.GetFiles(Path.Combine(tessNugetFolder,platform));
foreach (var file in platformFiles)
{
var fileInfo = new FileInfo(file);
var destFile = Path.Combine(destFolder, fileInfo.Name);
if (!File.Exists(destFile))
{
fileInfo.CopyTo(destFile, true);
}
}
}
In the Tesseract NuGet package, the native DLLs are in following folders:
\x64 \x86
Could they please be moved to the standard location? That is:
\runtimes\win-x64\native \runtimes\win-x86\native
This would enable Tesseract to work with tools such as LINQPad. (As it is, it can only work with MSBuild.)
Here's the documentation on naming folders in NuGet (jump to "Architecture-specific folders"): https://docs.microsoft.com/en-us/nuget/create-packages/supporting-multiple-target-frameworks.
And here's the complete list of RIDs: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog