Good Morning Laserfiche Community,
I hope all is well.
I am building a Laserfiche integration dll for a web application. The web application uses an IService.dll to Put, Get, Update, and Delete documents from laserfiche. All of the methods work properly and as expected except for the Delete. When the web application calls the Delete method , this exception is thrown "The type initializer for '<Module>' threw an exception". I have narrowed it down to this line "mySess.LogIn("admin", "admin", myRepoReg);" that cause the exception to be thrown. I was told that it might have something to do with domain marshaling but that was just a guess. I am out of ideas of what may be causing this and I am not sure how to troubleshoot and debug further since the exception seems to be thrown from further down the LF dll dependency tree, I think..
Well I hope all this makes sense. If you have any idea or guess as to what is causing this, please do share. Any information is helpful and appreciated. Thank you!
try { String servName = "ServerName"; String repoName = "RepositoryName"; // Using the overloaded RepositoryRegistration constructor RepositoryRegistration myRepoReg = new RepositoryRegistration(servName, repoName); Session mySess = new Session(); <strong><em><u>mySess.LogIn("admin", "admin", myRepoReg);</u></em></strong> // // //Entry.Delete(int.Parse(_id), mySess); File.AppendAllText(@"C:\errors.txt", "\n Deleted Document, ID:" + documentId + " details: " + mySess.HostName); return true; } catch (System.Exception excp) { File.AppendAllText(@"C:\errors.txt", "\n Error deleting Document ID:" + documentId + " Exception:" + excp.Message); return false; }