You are viewing limited content. For full access, please sign in.

Question

Question

Import files into Laserfiche through SDK and C#

SDK
asked on April 21, 2020 Show version history

Dear

I'm building a code in visual studio C# to start importing files into Laserfiche server.

Code:
               //Connection to server codes

                //Import files infto LF
                lfDoc = new LFDocument();
                electronicDocImporter = new DocumentImporter(); 

                electronicDocImporter.Document = lfDoc;

                electronicDocImporter.ImportElectronicFile(p_FilePath);

 

Am I missing anything ?

It's not working and it's always giving me an error  (Please find attached my error)

Please can you provide me a sample example of how importing files into Laserfiche?

LFError.png
LFError.png (5.72 KB)
0 0

Answer

SELECTED ANSWER
replied on April 22, 2020

I did some searching, and that guid that isn't resolving looks like it is assigned to version 8.1 of the Document Importer class. Does that make sense? Unless you're intentionally targeting such an old SDK you'll need to update your references to match the version you want to run. Also, the versions of LFSO and Document Importer need to match.

1 0

Replies

replied on April 21, 2020

80040154 is the Windows error REGDB_E_CLASSNOTREG, meaning that the COM class you are trying to create is not registered on the system. Is the SDK installed on this machine? Is it the appropriate architecture (x86 vs x64)? Beyond that, I don't think the code is right, you haven't given the system enough information about where in the repository the document should go. I think you need to create the document first, and then import into it. There should be code samples in the documentation.

All that said, if you are writing new code there's no reason to be using LFSO, you should be using the .Net components, like Repository Access.

2 0
replied on April 21, 2020 Show version history

Hi Brian,

Yes the SDK is installed on this machine, and I tried both architectures x86 and x64.

I don't know what's the next step to solve this issue.

 

Regarding the code, yes I agree, the code is not right, that's why I'm asking if there's a sample example.

You said I can find it in the documentation, where exactly? Is there any specific link?

Thanks in advance :) 

0 0
replied on April 22, 2020

Hello Ali,

Please try this path on the machine where you have installed Laserfiche SDK 

C:\ProgramFiles\Laserfiche\SDK10.2\Samples\LfSDKNetSamples.zip\CSharp

You can find some examples where you can have an idea on how to create a connection to you repository, and the proper way to import a document into it.

Mainly what you need is in the Import Util folder.

Hope it helps you! 

1 0
SELECTED ANSWER
replied on April 22, 2020

I did some searching, and that guid that isn't resolving looks like it is assigned to version 8.1 of the Document Importer class. Does that make sense? Unless you're intentionally targeting such an old SDK you'll need to update your references to match the version you want to run. Also, the versions of LFSO and Document Importer need to match.

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.