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

Question

Question

Could not load file or assembly LfLicenseReader

asked on December 21, 2016

When calling the below function I get an exception:

LFDatabase db = ConnectionManager.GetConnectionManager(Session).GetLoggedInRepository();

 

An exception of type 'System.IO.FileNotFoundException' occurred in WebAccessCommon.dll but was not handled in user code

Additional information: Could not load file or assembly 'LfLicenseReader, Version=9.0.0.2, Culture=neutral, PublicKeyToken=607dd73ee2bd1c00' or one of its dependencies. 

 

When I try to add the reference to LfLicenseReader.dll in the project, I get the following error when loading the webpage. 

Could not load file or assembly 'LfLicenseReader' or one of its dependencies. An attempt was made to load a program with an incorrect format.

 

Did anyone else face this issue?

0 0

Replies

replied on December 21, 2016

Adding a project reference is usually a step to resolve a compile-time error, when what you have originally is a run-time error.  After you add that reference, Visual Studio copies the file to the target directory, but it's the wrong architecture for your project and this is what the second error is telling you.  I would try removing the reference, and replacing the dll with the one that is correct for the process (almost definitely x64).

0 0
replied on December 21, 2016

I tried removing the reference and pointing to the SDK location

C:\Program Files\Laserfiche\SDK 9.2\bin\COM\x64\Interop.LFSO91Lib.dll

Ensured that "Copy Local" is set to false in properties.

During debugging I still get the error saying

An exception of type 'System.IO.FileNotFoundException' occurred in WebAccessCommon.dll but was not handled in user code

Additional information: Could not load file or assembly 'LfLicenseReader, Version=9.0.0.2, Culture=neutral, PublicKeyToken=607dd73ee2bd1c00' or one of its dependencies. 

Not sure what I am missing, I have the LfLicenseReader.dll file from sample project ED302_Advanced_Web_Customizations course but even the sample project that came with the course material fails. Don't know where to place the LfLicenseReader.dll file or if I need to register this file in GAC.

0 0
replied on December 22, 2016

Web Access should be installing it into the GAC.

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

Sign in to reply to this post.