Saturday 21 June 2014

Could not load file or assembly 'Microsoft.SharePoint.Client.Search, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified in Office 365

My Work env:

In Office 365, I have created an app with Search Service Application. When I add the app in the Office 365 site I got below error,

Server Error in '/' Application.
--------------------------------------------------------------------------------
Could not load file or assembly 'Microsoft.SharePoint.Client.Search, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SharePoint.Client.Search, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.

Source Error:
 An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.SharePoint.Client.Search, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' could not be loaded.

Solution:
Change the specific version is true for 'Microsoft.SharePoint.Client.Search' in DLL Properties.



Basic Command Scripts

To move File with Rename with Current Date and Time:  

for /f "tokens=1-5 delims=/ " %%d in ("%date%") do move "C:\Users\logan\Desktop\wf1\my.log"  "D:\my_%%e%%f%%g_%Time:~0,2%%Time:~3,2%%Time:~6,2%.log".

Create Event Log source using CMD:

   1. eventcreate /T ERROR /ID 900 /L APPLICATION /SO "Bauer" /D "Log for Bauer Application"
  2. eventcreate /ID 192 /L APPLICATION /T INFORMATION  /SO "HSEx
tranet555 " /D "Log for HS Extranet Application"

Get assembly files from GAC using PowerShell:

dir C:\Windows\Assembly -Recurse -Filter "VendorName*.dll" | foreach { copy $_.FullName C:\Temp }