Friday, 11 July 2014

The URL ‘[url]‘ is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web in SharePoint

My Work Env:

 I got the error "The URL ‘[url]‘ is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web"  in SharePoint 2010. The site was working fine, but after few days the SharePoint site got the error.

    In my scenario, the lookup filed does not give this error, because i don't use any lookup field in SP env.
(for ref : http://bernado-nguyen-hoan.com/2011/03/22/sharepoint-evil-1-the-url-url-is-invalid-it-may-refer-to-a-nonexistent-file-or-folder-or-refer-to-a-valid-file-or-folder-that-is-not-in-the-current-web/ ).

  Root Cause:
   My SharePoint site's DB machine has 0bytes free memory.

Solution:
   I freed some space, then site works as normal.

The server encountered an error processing the request. See server logs for more details in (.svc) WCF Service

My Work env:

When I tried to access the .svc file hosted in IIS, I got the below mentioned error

The server encountered an error processing the request. See server logs for more details.

I didn't get any other clue about this error.

Solution:

I added the line in .svc.cs,

config.UseVerboseErrors = true; in InitializeService() function.

Now I got a much clearer error message on the client side.

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 }

Wednesday, 7 May 2014

Change outgoing Email settings in SharePoint 2013

I have configured Outgoing Email settings in SharePoint 2013. But the FROM email id in the mail shows another Email ID, what actually I have configured in Outgoing Email settings in SharePoint Central Admin.

Root Cause :

    The web application which triggers the mail has different email ID what we configured in the SP Central Admin.

PowerShell cmd to check OutboundMailSenderAddress,

 (Get-SPWebApplication http://SPWebApp).OutboundMailSenderAddress

Check for both, web app and Central Admin URL.

Solution:

I have updated the OutboundMailSenderAddress mail address using SP Management Shell,

$webApp = Get-SPWebApplication "http://SPWebApp"

$webApp.OutBoundMailReplyToAddress = "no-reply@suglog4.net"

$webApp.OutboundMailSenderAddress = "sharepoint2013@suglog4.net"

$webApp.IncomingEmailServerAddress = "suglog4Mail"

$webApp.Update()

Note : If you have more than one WFE and APP server run the above script line for all the servers and check whether the OutboundMailSenderAddress user has updated.

Now check the both the SP Central Admin and  Web App OutboundMailSenderAddress user's are same.

PowerShell cmd to check,

 (Get-SPWebApplication http://SPWebApp).OutboundMailSenderAddress

Cannot connect to the configuration database



My Issue:

 Cannot connect to the configuration database

1. SQL services is in start state, but Restarted the SQL services
2. Checked AppPool in IIS and restarted all the web sites and AppPools are looking good. But still got same error. 

3. Checked the Event viewer it shows the below error.

Cannot connect to SQL Server. machine name not found. Additional error information from SQL Server is included below.Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

4. Tried to Login SQL using Windows authentication login failed and got response  "Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding."

5. But SA account Login successfully.

Solution:

Checked DC it was shutdown. Switched on the DC and everything back normal

Tuesday, 1 April 2014

The imported project "Microsoft.Silverlight.CSharp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

Silverlight 4.0 Projects not open in the Silverlight 5.0 installed machine and shows the below error
Error :
The imported project "C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Silverlight.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.



Solution:
In Silverlight V4.0 path has only  Microsoft.Silverlight.CSharp.targets file in the path, 
C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v4.0

but in Silverlight V5.0 has (C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v5.0) below files,
1. Microsoft.Ria.Client.targets
2. Microsoft.Silverlight.Build.Tasks.dll
3. Microsoft.Silverlight.Common.targets
4. Microsoft.Silverlight.CSharp.targets
5. Microsoft.Silverlight.VisualBasic.targets
6. XamlServices.dll
7. zlib114.dll

I copied all the Missing files except  Microsoft.Silverlight.CSharp.targets  and pasted in v4.0 path. Now projects loads without an issue.