Sunday, 28 September 2014

Redirect aspx website in IIS using C# code.

My Scenario:

  I want to access my domain www.myexample.com/in, when I try to browse my sub domain site  www.myexample.in.

Solution:

    I tried the below  code in my default.aspx page,

<%@ Page language="c#" Codebehind="default.aspx.cs" AutoEventWireup="True" Inherits="umbraco.UmbracoDefault" trace="true" validateRequest="false" %>
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.myexample\.in
RewriteRule (.*) http://www.myexample.com/in/$1 [R=301,L]

The direction is works fine.

Saturday, 6 September 2014

Your Certificate request was denied. "Denied by Policy Module 0x80070576, Active Directory Certificate Service could not find required Active Directory Information"

Error:

    Your Certificate request was denied

    Your request ID is <>. The disposition message is, "Denied by Policy Module 0x80070576, Active Directory Certificate Services could not find required Active Directory Information".



Scenario:

    When I tried to download the certficate from the Active Directory Certificate Server, I got the above error.

Solution:

    When I checked the time for the both DC and CS server both are different. My CS server was 1 hour ahead from the DC. I adjusted the time and the certificate downloaded fine.

Friday, 5 September 2014

Object Cache: The super user account utilized by the cache is not configured. This can increase the number of cache misses, which causes the page requests to consume unnecessary system resources in SHAREPOINT server

Error :

Object Cache: The super user account utilized by the cache is not configured. This can increase the number of cache misses, which causes the page requests to consume unnecessary system resources.
To configure the account use the following command 'stsadm -o setproperty -propertyname portalsuperuseraccount -propertyvalue account -url webappurl'. The account should be any account that has Full Control access to the SharePoint databases but is not an application pool account.
 Additional Data:
 Current default super user account: [MachineName]\system SharePoint 2010 is hosted on this machine.


Scenario :

The IIS APPPool account does not have access permission for the DB/tables and display the result.(in my scenario, SQL Server (SSRS) Reports not accessible).

Solution :

I gave DB_Owner permission for the user APPPool account to the DB.

Wednesday, 16 July 2014

Get Assembly Name of SP Timer Job

To Get Assembly (.dll) name of particular SP Timer Job use the below command,

Get-SPTimerJob -WebApplication "http://<SPSite>:<Port>" -Identity "<Timer Job Name>" | select Name, DisplayName,TypeName | Format-List

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.