When working on my community project SharePoint Client Browser I received multiple times the issue which related to the error message “The specified module could not be found”. The error log shows the error is thrown while authenticating with SharePoint Online.
File '' not found, check log file for detailed information. System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E) at Microsoft.SharePoint.Client.Idcrl.ManagedIdcrl.EnsureInited() at Microsoft.SharePoint.Client.Idcrl.ManagedIdcrl.LogonIdentity(String username, SecureString password) at Microsoft.SharePoint.Client.SharePointOnlineCredentials..ctor(String username, SecureString password) at SPBrowser.Entities.TenantAuthentication.InitClientContext()
What is weird about this, although a FileNotFoundException is thrown, the exception details do not indicate which file is actually missing. #Fail!
What also did not help with resolving my issue was missing automated packaging of the SharePoint Client Browser tool. This is definitely one of those reasons to automate your build process. To ensure the package contains everything it needs, instead of missing a single file due to manual packaging.
So, we do we actually need? When building a solution based on the SharePoint CSOM we require a set of assemblies. Depending we are building for SharePoint 2013 (v15) or SharePoint Online (v16) we need a different set. But what was causing the issue was not one of the CSOM assemblies!
Required assemblies for both SharePoint v15 and v16:
SharePoint CSOM assemblies:
Whatever you release in a package, make sure you include the MSOIDCLIL.DLL and MSOIDRES.DLL assemblies!