File Not Found Error and Enabling Logging

Nov 15, 2016 at 7:49 PM
Hello,

First - thanks for creating this tool. Your efforts are greatly appreciated!

I am running DIFS to test migrating files and metadata to SharePoint Online and am receiving the following error:

About to connect to source :
Source connected :
Source filled : 1 rows loaded
About to connect to destination :
Exception during import : File Not Found. : Microsoft.SharePoint.Client.Runtime :

I am not sure if it is referencing that specific DLL (which exists in the install folder), or if it cannot find the source file.

To try to answer this I followed the overview to enable logging but no log file is being created.

The app config and the job config (username, password and domain redacted) are below for reference. Are the settings in the former correct for logging?

Thanks!
<?xml version="1.0"?>
<configuration>
    <configSections>
    </configSections>
<startup>
  <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
  <system.diagnostics>
    <!-- By setting autoflush false the listener will not be written to; this can get BIG.  Set to true for troubleshooting -->
    <trace autoflush="true"></trace>
    <sources>
      <source name="SPImportHelper">
        <listeners>
          <remove name="Default"/>
          <!-- The log file specified below will contain full details the of import.  The user running the import must have write permission and autoflush must be set to true.  If left in the default program files directory you must Run as Administrator -->
          <add name="eventlog"
              type="System.Diagnostics.TextWriterTraceListener"
              initializeData="C:\temp\SPImportHelper.log">
            <!--
            <filter type="System.Diagnostics.EventTypeFilter" initializeData="Information"/>
            -->
          </add>
        </listeners>
      </source>
<?xml version="1.0" encoding="utf-8"?>
<DataSetImportSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Source>
    <SourceDataSetType>OLEDbSelect</SourceDataSetType>
    <OleDbSourceDataSetSettings>
      <ConnectionString>Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Temp\Documents Test.xlsx;Extended Properties="Excel 12.0 Xml;HDR=YES;IMEX=0";</ConnectionString>
    </OleDbSourceDataSetSettings>
    <OleDbTableSourceDataSetSettings />
    <OleDbSelectSourceDataSetSettings>
      <SelectStatement>select * from [files$]</SelectStatement>
    </OleDbSelectSourceDataSetSettings>
    <ODBCSourceDataSetSettings />
    <ODBCSelectSourceDataSetSettings />
  </Source>
  <Destination>
    <AuthenticationSettings>
      <AuthenticationType>Office365</AuthenticationType>
      <domain />
      <username>*************</username>
      <encryptedpassed>*************</encryptedpassed>
    </AuthenticationSettings>
    <DestinationItemSettings>
      <DestinationItemType>Document</DestinationItemType>
      <ItemExistsBehaviour>Overwrite</ItemExistsBehaviour>
      <ImportMappings>
        <ImportMapping xsi:type="ImportMapping_String">
          <DestinationField>Title</DestinationField>
          <SourceColumn>Title</SourceColumn>
        </ImportMapping>
      </ImportMappings>
    </DestinationItemSettings>
    <DestinationListSettings>
      <DestinationWebUrlRelative>/sites/CPX3Test</DestinationWebUrlRelative>
      <DestinationFolderUrlRelative>/sites/CPX3Test/Documents</DestinationFolderUrlRelative>
      <DestinationServerUrl>https://**************.sharepoint.com</DestinationServerUrl>
      <DestinationListName>Documents</DestinationListName>
    </DestinationListSettings>
    <SourceColumns>
      <SourceFileNameAndPath>FullName</SourceFileNameAndPath>
      <ContentType>ContentType</ContentType>
      <DestinationSubFolder>DestinationSubDirectories</DestinationSubFolder>
      <DestinationFileName>DestinationFileName</DestinationFileName>
      <Publish>Publish</Publish>
      <CheckInComment>CheckInComment</CheckInComment>
      <PublishComment>PublishComment</PublishComment>
      <PageLayoutASPXName>PageLayoutASPXName</PageLayoutASPXName>
    </SourceColumns>
  </Destination>
</DataSetImportSettings>
Coordinator
Nov 16, 2016 at 6:25 AM
This means that DIFS cannot find Microsoft.SharePoint.Client.Runtime.dll

Have not seen this behaviour before.

The logging is unlikely to tell you anything more.
  1. Have you tried doing run as admininstrator?
  2. Running difs.exe directly from the install dir instead of the shortcut
  3. Windows version?
  4. 64bit or 32bit windows?
  5. Was 32bit or 64bit DIFS installed?
  6. Are roaming profiles being used on the client PC/
Nov 16, 2016 at 5:39 PM
Hello,

Thanks for the response and for the confirmation. Responses inline below. I will continue to troubleshoot based on these items, and will update the post with my findings.

MadAboutImport wrote:
This means that DIFS cannot find Microsoft.SharePoint.Client.Runtime.dll

Have not seen this behaviour before.

The logging is unlikely to tell you anything more.
  1. Have you tried doing run as admininstrator? <<<Yes>>>
  2. Running difs.exe directly from the install dir instead of the shortcut <<<Yes>>>
  3. Windows version? <<<Windows Server 2012 R2>>>
  4. 64bit or 32bit windows? <<<64 bit>>>
  5. Was 32bit or 64bit DIFS installed? <<<64 bit>>>
  6. Are roaming profiles being used on the client PC/ <<<No>>>
Coordinator
Nov 16, 2016 at 6:36 PM
Sounds like you might be running this on your SharePoint Server?

Best run from a client PC.

I suspect DIFS might be finding an older version of the DLL installed by SP to the GAC.
Coordinator
Nov 16, 2016 at 6:56 PM
Also should mention that you will find a Powershell scripted import example in the install location.

Trying to execute the import from Powershell might give you a pointer of what the issue is
Nov 16, 2016 at 7:11 PM
Hello,

I did run it from a Windows 10 machine with a clean GAC. I ran the x64 installer as administrator, and ran the program as an administrator. Same error message. Very strange indeed - I will continue troubleshooting.

Thanks!
Coordinator
Nov 17, 2016 at 6:30 AM
Well each build of difs is tried an tested on a windows 10 64bit virgin machine.

Maybe the error is spurious and the problem is in config or destination configuration.

May be provide full additional detail on the problem

See help using DIFS
Nov 21, 2016 at 1:32 AM
Edited Nov 21, 2016 at 1:33 AM
Hello,

Running through PowerShell gave the exact same error message: "File Not Found. : Microsoft.SharePoint.Client.Runtime".

Downloaded the VS.NET project (older version from April). It does connect without the above error, but when it tries to upload the file the following error occurs:

Exception importing : \PSLT0164\IMStore\000\000\test.txt : The remote server returned an error: (409) Conflict.

There is no file with the same name in the destination library. I actually have never seen this error in SharePoint Online. Continuing to research but updating this thread in case you have seen this.

Thanks!
Coordinator
Nov 21, 2016 at 6:15 AM
The older version won't work since MS have changed things a little since then.

Everything you have told me indicates that you have two versions of the SharePoint client components installed since that old version targets a different version of the client components.

When you have the current version installed and use Powershell it will load the dll thus;

[System.Reflection.Assembly]::LoadFile($pathtoassembly+"\Microsoft.SharePoint.Client.Runtime.dll") | Out-Null

If you remove the pipe to Out-Null as below you will see any error. If there is a problem just doing this then it's nothing to do with DIFS but would be interested to know about.


$HelperAssembly = [System.Reflection.Assembly]::LoadFile($pathtoassembly+"\Microsoft.SharePoint.Client.Runtime.dll")

$HelperAssemblyName = $HelperAssembly.GetName();
$HelperAssemblyName.version


The DLL version you are loading should be;

16.1.5026.1200

If it is a different version then this has come from somewhere else as this is what DIFS installs.

If the error occurs elsewhere it would be good to know which line is triggering it.
Coordinator
Nov 21, 2016 at 6:24 AM
Just to clarify the version shown doing file properties on the DLL = 16.1.5026.1200

The version that PowerShell will show

$HelperAssembly = [System.Reflection.Assembly]::LoadFile($pathtoassembly+"\Microsoft.SharePoint.Client.Runtime.dll")

$HelperAssemblyName = $HelperAssembly.GetName();
$HelperAssemblyName.version

Major Minor Build Revision

16 1 0 0
Nov 22, 2016 at 4:57 PM
Hello,

Forest for the trees: I noticed that the original XML "/Lists/" was missing from the library paths. Once I fixed this the tool started importing.

I am having an issue regarding setting a lookup column value, but that is a separate issue. I will troubleshoot some more, and create a new thread here if need be.

Thanks again for your help!
Marked as answer by MadAboutImport on 11/22/2016 at 10:50 AM