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

Question

Question

Receiving System.TypeLoadException when calling Folder.GetFolderInfo

asked on January 13, 2022 Show version history

I am using the Laserfiche.RepositoryAccess SDK.  When I run the Folder.GetFolderInfo(path, session) command I get the following error...

System.TypeLoadException
  HResult=0x80131522
  Message=Could not load type 'System.Runtime.Remoting.Messaging.CallContext' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
  Source=Laserfiche.RepositoryAccess
  StackTrace:
   at Laserfiche.RepositoryAccess.CurrentOperationId.get_OperationId()
   at Laserfiche.RepositoryAccess.Session.SendRequest(HttpRequest request, String callerPath, String callerName)
   at Laserfiche.RepositoryAccess.Entry.GetFromServer(HttpUrl url, Int32 type, Boolean throwOn404, Session session)
   at Laserfiche.RepositoryAccess.EntryInfo.Refresh(Boolean keepChanges)
   at Laserfiche.RepositoryAccess.Folder.GetFolderInfo(String path, Session session)
   at LaserficheUtil.<FixMetadata>d__1.MoveNext() in C:\[Obfuscated]\LaserficheUtil.cs:line 36
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Program.<Main>d__0.MoveNext() in C:\[Obfuscated]\Program.cs:line 15

 

I am able to create the session and log into Laserfiche successfully in the SDK.  It is just after I log in that I am attempting to run the GetFolderInfo command that throws the exception.

I am using Version 10.4.2.103 of the SDK.  My program is a Console application using .NET 6.0.

 

NOTE:  It seems SDK version 10.3.0.242 works.  The error only occurs with version 10.4.2.103.

0 0

Answer

SELECTED ANSWER
replied on January 13, 2022

.Net 4 assemblies are not guaranteed to load in .Net 6. They may, but usually will fail if they call into classes or methods not available in .Net 6. That seems to be your case.

1 0
replied on January 13, 2022

When can we expect to get a version of the SDK that supports .NET 6.0?

1 0
replied on July 26, 2023

how can we fix this problem since there is no sdk update

0 0
replied on July 26, 2023

The Laserfiche API is the .Net Core version of the Laserfiche SDK.

0 0

Replies

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

Sign in to reply to this post.