Monday, December 16, 2013

Facts About SharePoint Log and Correlation ID

Facts About SharePoint Log and Correlation ID

Facts :

1- GUID attached to your logs/error messages when something happens.
2- Correlation ID is used per request-session.
3- You can find the Log files inside
       C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS\


How To Search Inside SharePoint Log:

1- Using Power Shell :

Short Description
get-splogevent | ?{$_Correlation -eq "<GUID>"}

Details
get-splogevent | ?{$_.Correlation -eq "<GUID>"} | select Area, Category, Level, EventID, Message | Format-List

If you want the Error Detail to be put into a text or log file instead :
get-splogevent | ?{$_.Correlation -eq "<GUID>"} | select Area, Category, Level, EventID, Message | Format-List > C:MyErr.log

2- Using SQL queries : 
   In your logging DB (usually called WSS_Logging and could be called something else)
   there is a view called "ULSTraceLog" which you can query :

select [RowCreatedTime], [ProcessName], [Area], [Category], EventID, [Message]
from [WSS_UsageApplication].[dbo].[ULSTraceLog]
where CorrelationId= 'C5CCAM46-38h9-5B5D-BN44-5242B8C3M2M3'

3- Get the current Correlation ID by using code :
     [DllImport ("advapi32.dll")]
     public  static  extern  uint  EventActivityIdControl(uint  controlCode,ref  Guid  activityId);
     public  const  uint  EVENT_ACTIVITY_CTRL_GET_ID = 1;
     public  static  Guid  GetMyCurrentCorrelationID()
     {
         Guid  g = Guid .Empty;
         EventActivityIdControl(EVENT_ACTIVITY_CTRL_GET_ID, ref  g);
         return  g;
     }


naadydev@gmail.com

SharePoint 2010 : Microsoft sharepoint is not supported with version 4.0.30319.18052 of the microsoft .Net Runtime

SharePoint 2010 :  Microsoft sharepoint is not supported with version 4.0.30319.18052 of the microsoft .Net Runtime

Solution :
           1- Open PowerShell :
           2- powershell.exe -version 2.0
           3- Add-PSSnapin Microsoft.Sharepoint.Powershell



naadydev@gmail.com


Thursday, December 12, 2013

Fix: Access denied error when using SPWebApplication.Update()

Fix: Access denied error when using SPWebApplication.Update()

Reason : 
             The reason was that the Remote Administration Access Denied was true by default.

Solution:
             To disable Remote Administration Access Denied using Powershell:
-------------------------------
 $contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$contentService.RemoteAdministratorAccessDenied = $false
$contentService.Update()
--------------------------------

Thursday, November 14, 2013

Monday, October 7, 2013

Operation is not valid due to the current state of the object System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded()

Operation is not valid due to the current state of the object  System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded() 












Solution :
- just Open Web.config for your application and add the following key inside <appSettings>:

<add key="aspnet:MaxHttpCollectionKeys" value="20000" />

- Sure you can put your value 


naadydev@gmail.com

Monday, September 9, 2013

SharePoint 2010 BackUp/Restore GUI Tool


SharePoint 2010 BackUp/Restore GUI tool

http://splight.codeplex.com/

Developed By : naadydev@gmail.com



Thursday, September 5, 2013

SharePoint CAML, Query and filter Lookup Field by ID (select * from Details List where lookup Field ID = value)

- SharePoint CAML,  Query and filter Lookup Field by ID
- Select * from Details List where lookup Field ID =  Value

CAML Query Should be like the following :

<Where>    
    <Eq>
    <FieldRef Name='MyField' LookupId='True' />
    <Value Type='Lookup'>1</Value>
  </Eq>      
</Where>


(SharePoint Capacity Management ) Software boundaries and limits for SharePoint

(SharePoint Capacity Management ) Software boundaries and limits for SharePoint

Learn about the tested performance and capacity limits of SharePoint and how limits relate to acceptable performance.

SharePoint 2013
http://technet.microsoft.com/en-us/library/cc262787.aspx

SharePoint 2010
http://technet.microsoft.com/en-us/library/cc262787(v=office.14).aspx

naadydev@gmail.com

Tuesday, September 3, 2013

Windows could not start the SharePoint 2010 Administration service on Local Computer

Windows could not start the SharePoint 2010 Administration service on Local Computer
Error 1053: The service did not respond to the start or control request in a timely fashion.

- Solution :

1- Start -> Run -> regedit

2- select the following registry subkey:
   HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control

3- Right-click Control, point to New, and then click DWORD Value.

4- In the New Value box, type ServicesPipeTimeout, and then press Enter.

5- Right-click ServicesPipeTimeout and then click Modify.

6- Click decimal, type the number of milliseconds that you want to wait until the service times out, and then click OK.
    E.g if you want to wait 60 seconds before the service times out, type 60000.

7- Exit Registry Editor and then restart the computer.

Saturday, June 8, 2013

Fix: No content databases in the web application were available to store your site collection

Restore-SPSite : The operation that you are attempting to perform cannot be completed successfully. No content databases in the
web application were available to store your site collection. The existing content databases may have reached the maximum number
of site collections, or be set to read-only, or be offline, or may already contain a copy of this site collection. Create anoth
er content database for the Web application and then try the operation again.


Solution :
1- Open Central Administration.
2- Open Application Management -> Click Manage Content Database
3- Select Your Web Application, Click -> Add Content Database
4- just create new Content Database under your web application and try to restore again.

naadydev@gmail.com

Saturday, May 25, 2013

Friday, May 10, 2013

Create Site Collection Under Other Site Collection Explicitly


1- Central Admin -> Manage Web Apps -> Select your App -> Manage Paths :

Path : YourSiteCollectionName
Type : Explicit inclusion

2- Try to Add site Collection Under your Current Site Collection "you will find your Path".

3- you can now Manage your Site Collection.


         naadydev@gmail.com

Wednesday, May 8, 2013

Create SharePoint Site Template

Create SharePoint Site Template 

Way 1:

1- Site Settings ->  Site Action -> Save as Template
http://yourServer:Port/SubSite/_layouts/savetmpl.aspx

------------------------------------

Way 2:
1- Open your site in SharePoint Designer 2010.
2- In Ribbon "Save as Template" 

-----------------------------------

Way 3: 

Using PoerShell

$Web=Get-SPWeb http://Servername:port/yourSite
$Web.SaveAsTemplate(“Template Name”,”Template Title”,”Template Description”,1)

- To Save With Content Data Use 1 otherwise use 0
------------------------------------
Once you saved your site as a template, a solution file (.wsp) is created and stored in the Solution Gallery for the site collection. And you can download or activate the solution. 

1- Browse to the top level site of your site collection -> Site Settings - > Galleries -> Solutions
2- To download the solution, just click its name in the Solution Gallery.
3- You Can uploaded and activated in the Solution Gallery
---------------------------------------
Import & Export
----
Import-spweb –identity http://MySite:8005/SubSite/ -path D:\nady\tawasul8005.cmp
Export-SPWeb –identity http://MySite:8005/SubSite/ –Path D:\nady\tawasul8005.cmp
==========================================

        naadydev@gmail.com

Tuesday, April 2, 2013

Fixing SharePoint: Namespace prefix 'xsd' is not defined

Fixing SharePoint :  Namespace prefix 'xsd' is not defined

Just Add this to page Or Master Header :

<meta http-equiv="X-UA-Compatible" content="IE=8" />

naadyev@gmail.com

Saturday, March 9, 2013

Referenced assembly does not have a strong name (How to sign Closed DLL)

Referenced assembly does not have a strong name (How to sign Closed DLL)


1- Open Visual Studio Command Prompt 
2- ildasm /all /out=MyLib.il  MyLib.dll    
3- sn -k mykey.snk
4- ilasm /dll /key=mykey.snk MyLib.il
5- Now your assembly has strong name and signed 

Tuesday, March 5, 2013

Crystal Report Viewer SharePoint 2010 Deployment , CrystalReportViewer in SharePoint 2010

How to Deploy Crystal Report in SharePoint 2010
CrystalReportViewer in SharePoint 2010

1- Install SAP Crystal Reports runtime engine for .NET Framework 4 (64-bit) :

http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_redist_install_64bit_13_0_1.zip

2- Inside "<SafeControls>"  Tag :


      <SafeControl Assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" Namespace="CrystalDecisions.CrystalReports.Engine" TypeName="*" Safe="True" SafeAgainstScript="False" />
      <SafeControl Assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" Namespace="CrystalDecisions.ReportSource" TypeName="*" Safe="True" SafeAgainstScript="False" />
      <SafeControl Assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" Namespace="CrystalDecisions.Shared" TypeName="*" Safe="True" SafeAgainstScript="False" />
      <SafeControl Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" Namespace="CrystalDecisions.Web" TypeName="*" Safe="True" SafeAgainstScript="False" />

3- Inside "assemblies" Tag Add :

 <!-- ========== Crystal ==============================-->
        <add assembly="CrystalDecisions.Data.AdoDotNetInterop, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
        <add assembly="CrystalDecisions.CrystalReports.Design, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
        <add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
        <add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
        <add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
        <add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
        <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
        <!-- ========== Crystal ==============================-->


4- Copy "aspnet_client" folder from "C:\>inetpub\wwwroot" and overwrite it on "C:\>inetpub\wwwroot\wss\VirtualDirectories\[Your Port]"


naadydev@gmail.com




Wednesday, February 20, 2013

Convert javascript Comma Separated String To Array Object

Convert javascript Comma Separated String To Array Object


var _returnedArray = _stringValue.split(',');


naadydev@gmail.com

javaScript , jQuery , Array Search and delete Array Element

javaScript , jQuery , Array Search and delete Array Element 



function Test() {
                var myArr = [4, 87, 66];
                var index = jQuery.inArray(87, myArr);                
                alert(index);
                myArr.splice(index, 1);
                alert(myArr);
            }


naadydev@gmail.com