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

Question

Question

lazy load LF dll

asked on February 12, 2016

I built a REST web service (.NET) that can be configured to use LF. I was hoping that if the web service is configred to NOT use LF, the LF dll's included in the deployment won't be loaded (lazy loading). But when I start the web service (when configured to NOT use LF), the IIS returns an error about failing to load Laserfiche.I18n.dll. That's because there is no LF SDK runtime installed on the server. The point though is that the web service shouldn't even try to load that dll.

There is nothing in my web service code (that I am aware of) that would run anything LF related. What exactly triggers the LF dll load ?

0 0

Replies

replied on February 12, 2016 Show version history

This isn't really a Laserfiche question, so you'll probably find better information elsewhere.  My guess is that you are seeing one of the following, depending on the specifics of your project:

  1. IIS is loading everything in the bin directory, including something that has that as a dependency.  http://stackoverflow.com/questions/508034/how-to-stop-asp-net-from-loading-all-assemblies-from-bin-on-first-load
  2. You have an explicit reference to the dll in your web.config, possibly added automatically by Visual Studio.
  3. What constitutes a dependency in .Net can be complicated.  Even if no thread would execute code in the LF SDK, all types present in a class or function have to be resolved.

 

For the last point, consider a function like:

void GetData(bool fromLaserfiche) {
    if (fromLaserfiche) {
        DocumentInfo doc = Document.GetInfo(Id, GetSession());
    }
    else {
        Stream s = GetDataStream();
    }
}

 

Because there are SDK types used in this function, the SDK has to be loaded in before any code here is executed.  In particular, it doesn't matter what the value you pass in for `fromLaserfiche`.

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

Sign in to reply to this post.