Monday, January 25, 2010

How to shrink SharePoint_Config DB

Hi all,

I had one of my SharePoint Configuration database for one of my sharepoint sites reached 122 GB since i had a problem on having any operation from the FE server to the DB server.

My installation for the DB server is SQL 2008, the problem is the transaction log is too large and to minimize or shirnk the size, here is the steps:

1) Take a full backup from your database - Important.
2) Change the DB recovery model to Simple ( Right click on the SharePoint_Config and click on properties -> Options - > Recovery model : change it to simple.

3) Open a new query in the management studio and write this shrink command:

DBCC SHRINKFILE('Sharepoint_Config_Log',1)

4) Check the HD free space, your free space on the HD has been updated.

5) Don't forget to return back the recovery model to full for any future backups.

Check the transaction log file (ldf file of the sharepoint_config) it has been shrinked to the minimum size.

In my case the transaction log has been shrinked from 122GB to 2MB.

Hope this helps.

Regards,
Mostafa arafa

Thursday, January 21, 2010

How to fix : "Directory ‘C:\Inetpub\wwwroot\wss\VirtualDirectories\80\_catalogs\masterpage’ does not exist. Failed to start monitoring file changes."

Hi all,

Today i ran through a problem when i tried to create a javascript function in my web part that call a server function in the code behind, to enable this, you have to enable pagemethods in your script manager object in the master page.

ajax:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"

adding this attribute EnablePageMethods causes the whole site stop working and you will get this yellow error page with the following error:
"
Directory ‘C:\Inetpub\wwwroot\wss\VirtualDirectories\80\_catalogs\masterpage’ does not exist. Failed to start monitoring file changes.

"

The fix for this problem, is a bug and a known issue, just install this hotfix KB957661 on your sharepoint front server.

Hotfix download link :
http://code.msdn.microsoft.com/KB957661/Release/ProjectReleases.aspx?ReleaseId=2293

Hope this helps :)


Regards,
Mostafa arafa

Saturday, January 16, 2010

SharePoint Saturday Event - EMEA - 23 Jan

Hi,
This is just a quick update to tell you I will be posting the speaker/session schedule for Live Online SharePoint Saturday EMEA on January 23rd later this week. We are going to have at least two channels running at once, possibly three.
We've got over 350 people registered, 6 Microsoft MVPs speaking, and 21 presentations! I would appreciate it if you would share/forward this post to three colleagues telling them about this free, live online event.
I'd love to see the registrations go over 1000.

Event Home: http://www.sharepointsaturday.org/emea/default.aspx
List of Speakers: http://www.sharepointsaturday.org/emea/Pages/speakers.aspx
List of Sessions: http://www.sharepointsaturday.org/emea/Pages/meetings.aspx
Registration: http://20100123-spsemea.eventbrite.com/

This looks like it's going to turn out to be one of the largest live online events we've ever seen for SharePoint.

Thank you for your participation in spreading the word.

Download my presentation :

http://cid-4bc94054914a6469.skydrive.live.com/self.aspx/Blog%20Code/SPSatrday%5E_SP2010%5E_SharePointDevelopmentTipcsTricks%20-%20Copy.pptx


Friday, January 15, 2010

Get Started with MS Surface - Part 1

Hi folks,

In This post i will mention some of my thoughts and findings in the MS Surface, It is amazing experience, this is the first post of its series, i will keep posting my posts about MS Surface.

Let me know asnwer the most FAQ for most IT guys:

1) What is MS Surface : Multi-touch table
Read more : http://www.microsoft.com/surface/

2) Which Development Tools can i use to develop my applications ? VS 2008 , Suface SDK 1.0 SP1

3) Do i need to have MS Surface to develop my applications ? You can develop on your development as workstation using Surface Simulator that will be installed if you installed Surface SDK.

4) What kind of application we can develop for MS Surface ? Surface application is basically WPF ( Windows Presentation Foundation) .Net applications.


I hope this helps, let me know what do you think about this ?


Regards,
Mostafa arafa

Tuesday, December 29, 2009

SharePoint Saturday - EMEA Event

Hi All,

Good News !!! First SharePoint Saturday @ EMEA will be held on 23 Jan 2010, If you are a sharepoint fan/developer/architect or Administrator, I encourage you to attend SharePoint Saturday online event, here is the link for the registration:

http://20100123-spsemea.eventbrite.com/

Speakers List:
http://www.sharepointsaturday.org/emea/Pages/speakers.aspx


I'm going to be a speaker on this event, meet you there.

My Session Info:

Session Topic : SharePoint 2010 Development Tips & Tricks
This session will cover the new development model for SharePoint 2010 and the new architecture design for the sharepoint foundation and the client object model.
The session will cover also other tips and tricks when developing sharepoint solutions and the best practices to following when developing sharepoint custom components and more....

Meet you there. Thanks.

Friday, December 11, 2009

How to build your DB on MS SQL Azure

Hi Folks,

I would like to share with you some tips for how to move your on-premise DB to MS SQL Azure on the cloud.

First, To be able to connect to SQL Azure Prepare your environment with the following:

1) Install MS SQL 2008 R2 on your machine - Nov CTP, having any other version of SQL 2008 will not give you the full functionality like working with object browser in SQL Server 2008 R2.

Tips :

a) Before installing SQL 2008 R2, please check your exisiting environment by using SQL Server upgrade advisor (it is a part of SQL 2008 R2).

b) Using your credientials in SQL Azure, you will be able to connect using SQL 2008 R2 with no issues and you will be able to navigate through your objects in the DB.

1) How to move your on premise Database to SQL Azure on the cloud:

1) Script your DB from your server.
2) There is some changes you have to do it on the script before executing it on the SQL Azure DB.

Tip: 1) Remove any reference to the file group such as : ON [PRIMARY] on your script.

Then when you remove the reference, you will be able to execute the script using SQL Management Studio and when you refresh the server you will be able to see your new created objects.

Hope this helps.

Regards,
Mostafa arafa @ Azure Cloud......

Tuesday, December 08, 2009

Cannot open a closed file error in asp.net ajax / SharePoint Site

Hi Folks,

I was developing a webpart in sharepoint ( consider it as a asp.net usercontrol for ASP.Net Developers) and in the webpart i was uploading a document using AsyncFileUpload control in AJAX Toolkit.

And it was working fine, but for some files i was getting this error : "Cannot open a closed file" and i was thinking that the problem from the file or it is a code behind issue.

I figure out the problem was because of the file size threshold in the web.config, the default web.config is:

<httpruntime maxrequestlength="51200" />

I added this attribute:

<httpruntime maxrequestlength="51200" requestLengthDiskThreshold="4096" />


The resolution for the problem is: Set the length disk threshold to 4M ( or any other number in KB as per your application business rule) because by default the value is 80K.

Hope this helps.

Happy SharePointing.... or .Netting :)

Regards,
Mostafa arafa

SharePoint Error : Retrieving the COM class factory for component with CLSID {BDEADEE2-C265-11D0-BCED-00A0C90AB50F} failed

Hi,

If you are trying to open your sharepoint 2007 site one day and you got this error message with yellow asp.net page:

"Retrieving the COM class factory for component with CLSID {BDEADEE2-C265-11D0-BCED-00A0C90AB50F} failed due to the following error: 800703fa."

The fix for this problem is to do iisreset for your IIS webserver and this will resolve the error.

Hope this helps.

Regards,
Mostafa arafa

Monday, December 07, 2009

Installing SharePoint 2010 on Windows 7 Tip

If you are planning to install sharepoint 2010 on Windows 7, here is an excellent article in MSDN, just follow the steps and you will end up successfully installing SharePoint 2010 beta on windows 7.

http://msdn.microsoft.com/en-us/library/ee554869(office.14).aspx

My Tip is: even if you follow the steps, and run the SharePoint Configuration wizard, the wizard might be failed , what you have to do is just to re-run it and it is going to work. the problem for that when you run in low of memory and the exception is saying failed provisioning central administration website.


Thanks.

Regards,
Mostafa arafa

Wednesday, December 02, 2009

Installing SharePoint 2010

Hi Folks,

I'd like to share with all of you how to install SharePoint 2010 on your current platform and to remove any dilemma or milestones you might face or heard from others.

First Question : How can i install SharePoint 2010 on my 32 bit machine ?
Now, you can use either VM Ware Workstation (requires License) or Virtual Box (Free).
Till Today, MS Virtual PC doesn't support to build your 64 bit machine on a your host 32 bit machine.

Now, you don't have any problem to build a VM using either of these software.

I used Virtual Box, and this is my first experience with it, easy and you can use your experience with VPC with it.

[Updated 6/12/09]: VMWare Server is also free, you can try it and its performance is better than Virtual Box.

Once you build and start your VM, here is the steps you have to do:
1- Mount your Windows 2008 R2 64 bit to your VM software.
2- After installing Windows, Install all the updates before start installing the SharePoint 2010.

3- I Prefer to install Office 2010 before installing SharePoint 2010 since you are going to use it with SharePoint.

4- Run Your SharePoint installer and click on install your software prerequisities, this step will go with no errors as mentioned on other posts.

5- The installer will prompt you to run SharePoint Products and configuration wizard, At the end, you will get a failure message : "Failed to create sample data".
FYI: SharePoint is working without installing the hotfix, To download the hotfix:

http://blogs.msdn.com/sharepoint/archive/2009/11/19/installation-notice-for-the-sharepoint-server-public-beta-on-microsoft-windows-server-2008-r2-and-microsoft-windows-7.aspx

After installing the hotfix, restart the machine and run the SharePoint configuration wizard again to fix un-provisioned services-WCF.

** Some Other Error cases - Differ from one installation to another:

a) If you got this error :"failed to register sharepoint services", open stsadm tool and type this command:

stsadm -o spsearch -action stop

Then re-run the configuration wizard.

b) If you get this error message :"failed to register sharepoint services- search service" - step 5 in the configuration wizard.

Open the command prompt and type : regedit and navigate to the following key and delete it:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web ServerExtensions\14.0\WSS\Services\Microsoft.SharePoint. Search.Administration.SPSearchService

6- Done, Start exploring your sharepoint 2010 instance.

Hope this helps.

Mostafa Arafa
Twitter : @mostafaelzoghbi

Tuesday, December 01, 2009

The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.

Hi,

"The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again." This error message in sharepoint 2007 you will get it because of different actions you may perform on the site level:

-If you are trying to check out a document in Document library.
-If you are trying to add some columns in a custom list in sharepoint.
-If you are trying to call update() method in the object mode.
-And other actions....

The reason behind this error is when you enable anonymous access to a site with other authentication method such as basic authentication.

The solution or workaround for this problem is to open the central admin, then :
- Select application management.
- Under SharePoint Web Application Management, select Web Application general settings.
- Select your web application first.
- Under web page security validation turn it off.
- Reset your IIS.

Hope this helps.

Regards,
Mostafa arafa

Wednesday, November 25, 2009

My Interview in Microsoft Feed Website

I'd like to share with all my blog readers this article, it is my interview with Microsoft Feed website team.

Read it, I think it will inspire you to do more in your career and to the community.

http://microsoftfeed.com/2009/meet-mostafa-elzoghbi-visual-c-mvp-from-egypt/


Regards,
Mostafa arafa

Thursday, November 19, 2009

SharePoint 2010 BETA is available now to download

Hi Folks,

SharePoint 2010 BETA is now available to download for Public, download link :

http://www.microsoft.com/2010/en/

SharePoint 2010 resources:

Devs: http://msdn.microsoft.com/en-us/sharepoint/ee513147.aspx

IT Professionals: http://technet.microsoft.com/en-us/sharepoint/ee518660.aspx

Read more :

http://blogs.msdn.com/sharepoint/archive/2009/11/18/sharepoint-2010-public-beta-is-now-available-for-download.aspx


Regards,
Mostafa arafa

Tuesday, November 10, 2009

Bulk delete in a SharePoint custom list

Hi All,

I went through an issue to bulk delete a custom list items in a sharepoint site, I found a good tool to delete all items / selected items in a custom list in sharepoint.

You can download from codeplex:

http://customlistitemsdel.codeplex.com/

Hope this helps.


Regards,
Mostafa arafa

Thursday, October 29, 2009

createwsp.bat exited with code 4 error

Hi All,

If you got this error while building a sharepoint solution file, this happens when the CabLib.dll which is used to build WSP SharePoint Solution files in VS.Net is a 32 bit running on a 64 bit machine.

The issue behind this is that your server is a x64 bit server, and you have to change this CabLib.dll with a 64 bit version.

You can download the updated dll from codplex:

http://www.codeplex.com/wspbuilder/Release/ProjectReleases.aspx?ReleaseId=16820

Hope this helps.


Regards,
Mostafa arafa

Tuesday, October 27, 2009

Performance Point Server 2007 SP3 is available

Hi All,

If you are building KPIs and performance point reports using Performance Point server 2007 with SharePoint 2007. A new Service pack is available to download with all important aggregated hotfixes.

Download link and important hotfixes information:

http://support.microsoft.com/kb/975249/en-us

Hope this helps.

Regards,
Mostafa arafa

Tuesday, October 20, 2009

Error when trying to open XAML options in VS 2008

Hi All,

After installing Silverlight 3.0 tools with VS 2008 SP1 i was not able to open XAML options in VS 2008 IDE.

I was submitted a ticket in MS Connect website, and the fix is:
1) Close all VS 2008 instances.
2) Open VS 2008 Command prompt
3) Type : devenv /resetskippkgs

This is the fix for the problem by resetting all IDE packages.

Ticket url:

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=496402

Hope it helps.

Regards,
Mostafa arafa

Session management in WCF service - client & server

Hi Folks,

I got the following email from one of my blog readers, here is his email:
"
Hi.. Marafacs,
I have a problem about WCF chat based on client-server. How to make a deal between server and client? So server can send message, show active client list, kick user.
Thanks for response.
"

To do this, you have first to configure your WCF to accept only client calls with sessions, and this is can be achieved by configuring the WCF with Service Throttling and configuring MaxConcurrentCalls,MaxConcurrentInstances and MaxConcurrentSessions.

Read this section to know how to configure this - page 331:
http://books.google.com/books?id=-AUyj6S7etwC&pg=PA331&dq=how+to+get+active+sessions+in+WCF&ei=tsTdStrhKITUNc_B9IEP#v=onepage&q=&f=false

To know, how the client can generate sessions and unique identifiers to the server, check below KB article, this is related to instance context sharing:

http://msdn.microsoft.com/en-us/library/aa354514.aspx

Hope this helps.

Regards,
Mostafa arafa

Thursday, October 15, 2009

MS Training website.... for solution providers

Hi Folks,

Interesting site By Microsoft, it provides training for solution providers, what you have to do is to write your topic, then you will find your material.

I was looking for silverlight 3, here is the link:
http://www.msdev.com/Directory/SeriesDescription.aspx?CourseId=122

This is the site url, keep it in your records...

http://www.msdev.com/

Hope it helps.

Regards,
Mostafa arafa

Tuesday, October 06, 2009

TechEd Middle East - March 2010

Hi All,

Big chance for all professionals in the middle east, TechEd Middle east in Dubai at 1 March 2010, TechEd is one of the most premier events for Microsoft in technology and networking.

"Microsoft’s premier technical education and networking conference is coming to the Middle East.
Connect one-on-one with Microsoft insiders and IT peers, get your toughest questions answered and hear expert advice - right from the source, right in your region."

http://www.TechEd.ae/


-- RSVP on Facebook:

http://www.facebook.com/event.php?eid=162414912532&ref=nf

See you there....

Regards,
Mostafa arafa