Friday, December 17, 2010

FIX IT: ASP.NET 4.0 registration problem after enabling WCF activation feature in IIS 7

If you recently enable WCF HTTP Activation Feature in IIS 7, you might face this prolem when you try to navigate to your WCF service that is targeting .Net Framework 4.0:

Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

To fix it:
1) Open VS Command Prompt.
2) Type the following command to re-install ASP.NET 4.0 and register the right .NET Framework.
aspnet_regiis.exe -iru
3) Refresh your WCF host url, it works :)

Hope this helps.
Mostafa Arafa

FIX IT: HTTP 404 Not Found problem when deploying WCF in IIS 7.0

Hi Folks,

I was developing a WCF syndication service to be deployed on Windows Azure, I faced a problem that when you deploy the WCF service in IIS 7.0 it doesn't work and gives the following error in the browser: HTTP 404 Not Found. I checked the deployed service it contains the dlls and configuration files. After few minutes i figured out that the problem is in one of IIS features is not enabled which is the WCF activation feature.

To fix this problem:

1) Open control panel.

2) Select programs.

3) Select Turn on/Off windows Features.

4) Look for Microsoft .Net Framework 3.5.1

5) Check WCF HTTP Activation and Non Activation check boxes (BOTH).

6) Click ok.

7) Now your IIS is configured to host WCF services with HTTP activation and non HTTP Activation requests.
Hope this helps.
Happy New Year :)

Mostafa Arafa

Tuesday, November 30, 2010

Announcing New Bing maps AJAX toolkit

Hi All,

New Bing Maps AJAX control has been announced to be used on your applications. This version has been developed from the ground up to be faster and more efficient than the previous version.

Today on the Bing Maps Blog we announced the release of the new Bing™ Maps AJAX Control 7.0-our flagship for the desktop and mobile web. We built it from the ground up to be agile and fast, and it shows: at launch, the control is less than one-third the size of our previous AJAX Control 6.3 and renders multiple points nearly three times faster.*

Bing Maps Control ver. 7 :

Help in CHM or PDF format:

Bing Map control is being used on your application to visualize your location based information.

Hope this helps.

Regards,Mostafa Arafa

Thursday, October 28, 2010

Integrate External SharePoint 2010 List to Outlook 2010

Hi All,

A friend of mine asked for how to integrate SharePoint 2010 external list that is configured to pull information from an external system into outlook 2010.

So, To begin the office 2010 has unique and enhanced integration with sharepoint 2010, If you are able to configure SharePoint 2010 to pull data from external data using BCS Exteranl List. You will be able to manage this list in outlook 2010.

First, When you create external list that is designed to be used in outlook the ECT ( Exteranl Content Type ) has to be with type Office item type and select from the options: Task, Post, Appointment or contact.

How to connect to external list using SPD:
1) Open SPD with the SP site.
2) Select External content type and click on External content type from the ribbon.
3) Type the ECT name and select the office item type from the list.
4) select the data source and do the mapping.
5) Note: You have to map the fields to the appropriate office mapping.
6) Save your ECT and click on Create Lists and Form from the ribbon.
7) Now you have the ECT and the list in the SharePoint Site.
8) Before test the list, set the permission to the External list from the central admin -> application management -> application services -> select BCS -> select your list and click on set permissions - > provide the required permissions per user.
9) Visit your SP site and click on lists link and select your list to check it.

Note: I went through how to create ECT and External List in SP 2010. There is more tips and security best practices for above items - Please check MSDN how to setup BCS with SSS service.

How to get the created external list on your outlook ?
1) Select your list.
2) Select List tab and click on connect to outlook.
3) an Add-In will be installed and configured to your outlook 2010 to the list.

Now, You will be able to manage the list once the configuration is done and outlook will be launched automatically once SP 2010 is done with the configuration.

Another Question: How can i change the mapping for the created ECT ?
The only thing you need to do is to open SPD and select your ECT - > Read Item and then click on Edit Operation from the ribbon and change the ECT field mapping and save it.

Tip: if you have your outlook 2010 is opened, and you right click on the contact list and run the sync option you won't be able to get the new mapping fields. Close the outlook and open it again.

Hope this helps.

Mostafa Arafa

Wednesday, October 20, 2010

Avoid Run Time Errors while deploying SharePoint 2010 Solutions

Hi All,

Through my discussions with developers and attendees in SharePoint Events, I was getting a lot of questions about the target .net framework for applications and solutions that are built against Server and Client Object Model in SharePoint 2010.

I decided to list the things you need to take care and set before start compiling and deploying your solutions and getting runtime errors using SharePoint object model.

1) If you are developing a SharePoint 2010 Solutions. You solution has to target .NET Framework 3.5 Only and Not 4.0.

2) Also, if you build your solutions as layers and you have different projects ( Non SharePoint Project) all are used within your SharePoint project, ALL OF THEM HAVE TO TARGET .NET FRAMEWORK 3.5 as well.

3) Your target CPU platform can't be x86. Even if you are building a console application using the client object model. The Solution ? Next Point.

4) It's recommended that all your projects to target Any CPU platform, You can't have some projects are targeting x86 ( Such as Console Application ) that are referencing x64 CPU platform.

5) You have the option "Less Recommended" to target all your project to x64. but in this case your solution will not be able to run on x86 machines. Instead, Select Any CPU platform as recommended on Point 4.

6) If you made all your projects to target Any CPU, the only point you have to put in your consideration is the file size for your solution will be bigger than if you target x64 CPU platform.

7) If you decided to enable x64 configuration, here is the steps you need to do in VS 2010 and the resource of this post:

Hope this helps.

Regards,Mostafa Arafa

Saturday, October 16, 2010

Sandbox Solutions in SharePoint 2010

Hi All,

Today i was presenting in SharePoint Saturday DC Federal and the event was hosted in Booz Allen Hamilton in McLean,VA.

I enjoyed the questions from Devs,Architects and attendees. It was really awesome meeting you all. The questions were primarily for secured sandbox solutions which are important for the federal employees and secured environments.

In this session i covered the following topics:
1) Sandbox overview.
2) Sandbox life cycle.
3) Developing and Deploying Sandbox solutions.
4) Custom workflow actions in workflow.
5) Custom Validator.
6) Resource Management.
7) Blocking Sandbox Solutions.
8) Points to metrics equation and how to convert points to different units.

And more...

Presentation url:

Demos url:

Hope this helps.

Regards,Mostafa Arafa

Sunday, October 10, 2010

My session in Richmond Code Camp - SharePoint Development using VS 2010

Hi All,

Saturday 9th October we had a code camp in Richmond, Virginia. The Code Camp was full of new and challenging topics: Windows 7 Mobile Development, Windows Azure Development, Silverlight, WCF Data Services and JQuery and set of other topics.

My session was talking about SharePoint 2010 Development using VS 2010. In this session I covered set of great tools in VS 2010 for SharePoint Developers such as:
Feature Designer, Package Designer, SharePoint Explorer, Feature Dependency, Mapped Folders, Deployment Options and Activation steps.

The presentation has been uploaded:

Feel free to share it and use it with developers and community talks.

Regards,Mostafa Arafa

Friday, October 01, 2010

Generate machineKey for your web.config in .NET

Hi All,

We were implemeneting Single Sign-On for our enterprise ASP.NET applications, I have been asked: How can we generate our own machine keys in our web.config ? Here is the console application you need to run and to get a random key based on the length you need and then add it to your web.config.

C# Code:

static void Main(string[] keyLength)

int len = 128;
if (keyLength.Length > 0)
len = int.Parse(keyLength[0]);
byte[] buff = new byte[len / 2];
RNGCryptoServiceProvider rng = new
StringBuilder sb = new StringBuilder(len);
for (int i = 0; i < buff.Length; i++)
sb.Append(string.Format("{0:X2}", buff[i]));


If you didn't pass anything to this method will generate 128 character key (64 byte), If you want to get 32 byte key, you need to pass 64 as key length input.

If you are trying different cryptography algorithms provided by System.Cryptography namespace in .NET Framework so here is the reference you need to read for what is the required length for each algorithm ? either if you are using: DES,3DES,AES,SHA1...etc.

Hope this helps.

Regards,Mostafa Arafa

Thursday, September 30, 2010

Why do we need managed accounts in SharePoint 2010 ?

Hi All,

SharePoint 2010 shipped with a new feature called "Managed Accounts". Managed accounts is a feature that allow sharepoint farm admins and system engineers to manage service accounts/Services created for the sharepoint 2010.

For Example: you might need a service account for your application pool or different accounts for the Sandbox solutions in SharePoint. So, You have to keep those service accounts with their password in a secured file in your system. If the password for one of those accounts has been changed, the result of this your service account will stop functioning.

The solution for this comes with SharePoint 2010 that you can register your service accounts as a Managed Accounts, and you don't need then to remember the password once you register them in your farm. and also the sharepoint 2010 will take care of the password expiry policy that you have in your organization by creating a new strong password and notify you as well. At the same time you can change the managed accounts that manage the service applications/services from the central administration.

How can i register a service account in my far ? here are the steps:
1) Open Central administration.
2) Select security.
3) Select Managed accounts.
4) Type your domain username and password you would like to register.

5) Optional, configure SharePoint to notify you if you have password expiry policy by creating new password.

Tip: This is a good practice to enable SharePoint to generate the password for you and send a notification to you. Even if you are working in an organziation with high password requirement's policy in there, you can let SharePoint change it for you automatically to keep your environment secure and you can change it after that as well.

Once you register your managed accounts in your farm, you can then change those managed accounts to different service applications in SharePoint.

How can i change the service accounts for SharePoint services?
1) Open Central Administration.
2) Select Security.
3) Select Manage Service Accounts.
4) Select the service application and the required managed account.

Tip: Once you select the service application, you will be able to assign to any managed account in your farm.

Summary: It's recomended to create your managed accounts and use it across your farm without the need to remember the password for your accounts.

Hope this helps.

Mostafa Arafa

Monday, September 27, 2010

Create Reports by Business users and deploy it to SharePoint 2010

Hi All,

Usually the business users are trying to create reports for their backend DBs. You can build your own Report and deploy it to SharePoint 2010.

Without using VS.NET you can develop and create your reports using FREE Reporting tool called "Report Builder". In this tool, You can connect to your DB and build your report.

To Download SQL 2008 R2 Report Builder tool, Here is the link:

Once you have "SQL 2008 R2 Report Builder 3.0" tool, You can connect to your DB and you will be able to create Charts and Reports.

Once you are done, You can deploy the report by saving it locally "*.rdl" then from sharepoint Document library with Report Builder content type, You just need to upload the rdl file to the document libarary and once you click on the report you will be able to see it.

TO create the document libaray with Report builder content type, check this blog post:

Once you create the document, Just upload the rdl to your Document library.

If your farm is not configured to allow SSRS reports in SharePoint 2010, read this blog:


Regards,Mostafa Arafa

Monday, September 20, 2010

TFS 2010 and Project Server 2010 Get Started

Hi All,

One of my colleagues asked me for useful links of TFS 2010 : Get started and training materials and Project Server 2010. Kindly find below links:

1) TFS 2010:
Homepage for all required materials for TFS 2010: Features, Training Kits, Installation and requirements management..etc:

Administration and installation guide for TFS 2010:

Supplemental guide for TFS 2010 - CodePlex:

2) Project Server 2010:
Get Started with Project Server 2010: Articles and Video series

Instructor-Led training and Course Training

Microsoft Project server: Features, Project Life cycle management + blogs

Hope this helps.

Regards,Mostafa Arafa

Thursday, September 16, 2010

SharePoint Governance Tip: Manage Self Site Creation Service and un used sites in your farm

Hi All,

I was implementing Site Creation governance practices, and i came out with the idea of this post, and I'd like to share 2 governance tips:

1) Self Site Creation Service: It is a SharePoint 2010 service that allow users to create sub sites within their site collections.

To configure Self Site Creation (SSC)Service:
Note: By Default is service is off on your web application.
1. Open SharePoint Central administration.
2. Click on Application Management Tab.
3. Under Site Collection, Click on Configure Self-Site Creation service.
4. Select your web application and select "On" from the choice option.
5. Check "Require secondary contact" to force the user to add another user to be a site administrator other than himself.

Note: When any admin clicks on OK button, A new item will be added to the announcement list of the top level site.

As a user, try to go to the top level site and click on lists and select Announcements. and you will find a new entry has been added, Try to open it, The item will have this url for users:

This is the page that any site user can create a new site within the site collection.

** You can manage the SSC service using the stsadm tool:
Enable SSC serivce:
stsadm.exe -o enablessc -url -requiresecondarycontact
Disable SSC service:
stsadm -o disablessc -url

2) As a SharePoint Farm Admin if you enable this service, the next question will be:
How can i remove or take an action for un used sites? This answer is: by configure "Confirm site use and deletion":
1) Open Central Administration.
2) Select your Web Application.
3) Check the box to send email notifications after specific # of Days let's say : 60 Days
4) Specify the duration that you need backend timer serivce to check for the existing created sites: Preferred to be Daily and you can select any time as per your policy.
5) You can check to delete all site content if the site use wasn't confirmed by the site admin after specific # of notifications. (Option)

After you configure Site use confirmation and deletion you will be able to manage and monitor your site collection activities and # of sites and keep your farm operates with good performance by managing # of sites hosted on your farm.

If you are looking for a template document for site creation and maintanance sheet, check this link:

Hope this helps...

- stsadm to manage ssc service:

Mostafa Arafa

Tuesday, September 14, 2010

Bing Maps troubleshooting WCF services: Geocode Service

Hi All,

I was developing a WCF service that consume Bing Maps Geocode Serivce, and when i was trying to create an object from the geocodeservice, i was getting this error :

{"An endpoint configuration section for contract 'GeocodeService.IGeocodeService' could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration section by name."}

C# Code for creating a Geocode service object:

GeocodeServiceClient geocodeService = new GeocodeServiceClient();

This is beacause i have more than endpooint for my service, please check your Web.Config or the service configuration file if your WCF is not hosted within web application. You will find at least 2 endpoints are defined for your service, To fix the problem :

1) Either to remove one of the endpoints definition.
2) Keep all endpoints and select which endpoint you want to use in your code - This is the preferred solution.

C# Code for the fix : 2nd option

GeocodeServiceClient geocodeService = new GeocodeServiceClient("BasicHttpBinding_IGeocodeService");

I selected the basic HTTP binding for my service. and you can select any of your choice and you have to specify this in your code.

Hope this helps.


Sunday, September 05, 2010

System Services/ Service Applications in SharePoint 2010

Hi All,

In this post, I’d like to share some thoughts about SharePoint 2010 terms in regard of planning your SharePoint Farm. I will show in details the differences between some terms such as: System Services, Application Services, Cross-farm services, Single-farm services, Services associated or not to a service applications and How to configure each of them in your SharePoint Farm.
If you are familiar with SharePoint 2007, Service applications are the equivalent to Shared Services in SharePoint 2007.
1) System Services: In SP 2007, some common services were combined under Shared Services service (search, user profile…etc.), in SP 2010, each service is a standalone application, called Service Application. In SP 2010 you can configure each service application alone. Some of these system services are associated or not with a service application.
To configure System Services in SP 2010, follow these steps:
1) Open SP 2010 Central Admin
2) Select System settings
3) Click on Manage services on server
You will be able to select the servers within the farm and Start/Stop them
2) Web Application and system services: Once you create a web application in your farm, all system services are associated to your web application, You can configure which service application would you like to associate with your web application, to do so:
1) Open SP 2010 Central administration
2) Select Application Management
3) Click on Manage configure service application association
4) Click on your web application and select the required system services required
5) Select custom from the drop down list to start configure the system services associated with your web application

3) Cross-farm services vs. Single-farm services:
Cross-farm services: are the services that can be shared across different farms within the organization such as: User Profile, Managed Metadata, BCS, Search, SSS and Web Analytics.
Single-farm services: are the services that can be configured only within only one farm such as: State service, Master data services, Performance Point, Excel Services, Access Services, Word Services, Word Viewing, Power Point and Visio Service.

Mostafa Arafa

Wednesday, September 01, 2010

How can you deploy Windows LIVE Project Template on Azure

Hi All,

If you are developing windows live application using Window Live SDK June CTP, You won't be able to deploy your windows live application on windows azure if you didn't update your web.config by adding the following section: diagnostics.

PROBLEM: You won't be able to view any page in your web role project, and you will get a blank page.

CAUSE: Missing web.config section needs to be set on the Windows Live Project Template in VS 2010

To add this section do the following:
1) Create a new web role project in your solution.
2) Open web.config file.
3) Copy the section system.diagnostics and add it in your windows live application.
You will notice that you don't have this section on your windows live application.


5) Note: Try to update your host file by commenting the entry you have added, so when you deploy it you will be able to use the deployed url and not the host file entry that points to the localhost

Try to run the cloud service now and you will be able to view the default page of your web role.

This blog post is a result summary from my MSDN thread below:

To download Windows Live SDK - June CTP for VS 2010:

Hope this helps.

Mostafa Arafa

Thursday, August 26, 2010

Troubleshooting Cloud Service Deployment in Azure

Hi All,

I was working on last few days to deploy a sitefinity CMS website to the cloud on Windows Azure. I faced different problems and stop points while trying to deploy my Cloud service to Azure.

In this post i will share the main check points that you have to go through before start deploying you application to the cloud, since if you tried to deploy your application and you were getting either runtime errors or you can't start your service on the cloud or any other problems you might face because of missing files or verification points you have to do on your development fabric environment before deploy to the cloud.

1) Make sure that web worker role is compiled with no errors on your development machine.

2) Make sure that all custom DLLs that you have reference for are copied to the output file, To do this, right click on all your custom or third party dlls and open properties window and select Copy to output directory to COPY ALWAYS.

3) Run your service and make sure that you are not getting any runtime errors on the development fabric -Local before start deploying.

4) If you published your service, and when you are trying to start it, it keep stopping, this means there's a problem on your service package file.

5) If you are having any problem starting your cloud service, Install this tool (IntelliTrace) on your Visual studio 2010 Ultimate edition.

6) If you face any problem, from Azure web portal, you can submit support ticket for your problem, the tip is include your subscription Id and Deployment Id on your ticket to get fast and reasonable resolution with analysis.

7) If you are using VS2010, Use Server explorer to navigate through your azure account components.

8) Using SQL 2008 R2, Script the DB ( Schema + Data ) and then connect to the SQL AZURE using SQL Server Management Studio.

9) IMPORTANT: Before deploying your website, make sure to update the web.config to point to the SQL Azure DB. If you miss this step, You might encounter a problem while deploying your web application when you try to start the application and the solution keep moving to stopped state because of trying to connect to the DB.

10) Advice: If you had the problem of your application keeps moving to the stop state, what you need to do is to submit a ticket to the support team and they will be able to check your VM event log and guide you to fix it since they are a lot of parameters to look at when you deploy.

Hope this helps.

Mostafa Arafa

Tuesday, August 24, 2010

Upgrading Sitefinity 3.7 from a website to ASP.NET Web Application

Hi All,

I was trying to deploy a Sitefinity website to the cloud Azure. One of the requirement to add a web worker role to a Cloud service is that THE WEB WORKER ROLE HAS TO BE AN ASP.NET WEB APPLICATION AND NOT AN ASP.NET WEBSITE.

Telerik only provides Sitefinity 3.7 as a website installation, So my mission was to convert this website to an web application just to start deploying the project.

So, In this post i will show in steps how to do this:
1) Create a new ASP.Net web application targeting .NET 3.5
2) Copy all your files (Pages, User Controls...etc) to the new created web applications.
3) Add all required references to the new web application.
4) Copy the content of the web.config file to the new web application.
5) Right click on the web application project and selects convert to web application.
6) You will get set of errors that Profile doesn't exist on the new web application:
The reason behind this is you didn't import the PROFILE class in your web application, To do this:
a) Click on below link and download profile builder:
b) Install the "Web Profile Builder" on your machine.
c) follow the steps to update the project file mentioned on the "" codeplex site.
c) Make sure that you got WebProfile.cs in your project.
d) You might need to add your assembly reference Using in the classes where there are referecnes to Profile class.
e) Replace all Profile,CommonProfile object declarations with WebProfile.

7) Try to build your application with no errors.

Note: If you added any files to the website and then you copied it the web application, DON'T FORGET TO CLICK ON CONVERT TO WEB APPLICATION TO CHANGE THE SOURCE FILE REFERENCES.

Enjoy Sitefinity on the cloud.

Will post any other difficulties on deploying Sitefinity on Azure.


Mostafa Arafa

Saturday, July 31, 2010

Sandbox Solutions in SharePoint 2010 session - SharePoint Saturday New York City

Hi All,
We had a successful SharePoint event in New York City on 31 July 2010 at Microsoft - Manhattan Office. On this event i presented a session covering: "SharePoint 2010 Sandbox solutions best practices",

In this event i covered the following topics in Sandbox solutions:
Sandbox solutions overview, Sandbox Architecture, SP 07 solutions challenges and SP 2010 approach, Sandbox solutions life cycle, limitations, SP Power Tools for VS 2010, Resource management for sandbox solutions, Load balancing and solutions validation framework.

The session was so interactive and i had amazing group between SP developers and SP Admins/Architect and we had nice conversation about sandbox solutions best practices and how admins can check developers' work.

What were the most interesting things/topics in the session- summary:
1) SharePoint Power Tools for VS 2010 and how to download it using Extension Manager in VS 2010.
2) Sandbox architecture and the SPUCWorkerProcess and how SP handle the lifecycle of loading/validate the sandbox solutions.
3) Sandbox solutions project items that you can develop such as: workflow activities, content types, site columns, visual webpart support ( HOT Topic having SP power tools in VS2010)...etc.
4) Resource management / solutions blocking.
5) Importance of solution validation for any organization.

Event - Share the stories:
This section is not technical, but it shows some fun time during the event.

Speakers' fun: @ Speakers' room
I was talking with few speakers that i bought a new notebook for my travels, that
has super configurations and RAM and very light and at the same time the battery life is 8 hours :) and i asked them how much do yo think i bought this laptop: and they gave me prices from 700-1500 $, then when i just said i bought it with 200 $ throught a sale- brand new, one of the speakers told me from which truck did you get it Mostafa ?!!! this was so funny and interesting.
Discussions among: Thomas M Daly, Ricardo Palhano, Eugene Rosenfeld and myself :)

** Event Url:

** Presentation Url:

Regards,Mostafa Arafa

Thursday, July 22, 2010

How to setup Telerik Sitefinity on Window 7

Hi All,

I'd like to share with my blog readers my struggling moments and issues i went through few days ago setup the Sitefinity/Telerik controls on my development machine which has Windows 7 Enterprise x64 bit.

If you are trying to install Sitefinity 3.7 SP3 on your box you will get different errors. and if you tried to integrate Telerik controls on your existing Sitefinity you will get more troubles because of dll dependencies between different builds.

The way to install Sitefinity 3.7 SP3 in your windows 7 x64 bit is to do the manual install to Sitefinity, it is easy and straight forward, they provide pdf file on how to do it.

Once you install Sitefinity on your box, if you would like to add your custom pages and develop using Telerik controls, don't try to install another Telerik control package form the site, Use the following dll in your project bin to have telerik controls.

** Steps to have Telerik controls for existing sitefinity project in VS 2010:
1) Open toolbox window.
2) Create a new tab on the toolbox.
4) Right-click under the created tab and click on add items.
5) Navigate to your bin folder.
6) Select Telerik.Web.UI.dll and click ok.

Then, you will have all Telerik ASP.NET controls on your toolbox.

Enjoy Telerik and Sitefinity... :)

Regards,Mostafa Arafa

Wednesday, July 07, 2010

WebMatrix and RAZOR for web development with no cost

Hi All,

Microsoft released the WebMatrix platform (FREE) that has all you need to build any websites, with WebMatrix you can do:
1) Design your websties.
2) Develop/Deploy your websites using RAZOR: is a new declarative simple language to build your websites.
3) Platform support ASP.NET, WebForms, MVC, AJAX, CSS and all the power of .NET Framework.
4) It’s just 15 M to download.
5) It includes IIS Express, SQL Compact,.NET Framework runtime and all you need to develop websites.
6) Scale up your sites to VS 2010 and SQL Server 2008 if required.
7) Download and build websites on open source CMS such as Word Press, Drupal 7, PHP and MySQL.
8) More….

Get a quick tour:

Code without boundaries using WebMatrix and start developing websites with no cost for the tools :)

Mostafa Arafa

Tuesday, July 06, 2010

Visual Studio 2010 MSDN Gift from VS 2010 Product Team

Hi All,

I have just got a mail from Microsoft - .Net Framework and Visual Studio Product team including this message:

"On behalf of the entire Visual Studio and .NET Framework product team, i would like to extend our heartfelt thanks for all the hard work you put into helping us make Visual Studio 2010 and .NET framework 4.0 one of the best releases we have ever shipped. We realize that you have invested a lot from your input, and we deeply appreciate your commitment to help us build a better product.

The importance of the community and early adopters providing feedback as we built Visual Studio 2010 and .NET framework 4 cannot be understated. You made the product better,working with us closely through the product development phase by submitting bugs and providing feedback. it is always your goal to empower you to be better developers by bringing you the best quality product with the features you need. You contribution is invaluable in helping us to achieve that goal and deliver the right product.

Again, Thank you so much for helping us build a better Microsoft Visual Studio 2010 and .NET Framework 4.0.

All the best,
S. Somasegar
Senior Vice President,
Microsoft Developer Division

Thanks Microsoft and .NET Framework & Visual Studio Product Team for this valuable gift with 3 MSDN Visual Studio 2010 Licenses.

Will continue providing feedback and enhancements to VS Product team to have most reliable experience for .NET Developers.

Mostafa arafa

Thursday, July 01, 2010

Renewed as C# MVP 2010


Today i got an email from Microsoft about renewing my MVP status and i have been renewed as C# MVP this year 2010.

Dear Mostafa Elzoghbi,

Congratulations! We are pleased to present you with the 2010 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in Visual C# technical communities during the past year.

The Microsoft MVP Award provides us the unique opportunity to celebrate and honor your significant contributions and say "Thank you for your technical leadership."

Toby Richards
General Manager
Community & Online Support
At Microsoft, we believe that technical communities enhance people’s lives and the industry’s success because independent experts, like you, help others extract greater value from products and technologies through the free and objective exchange of knowledge. As a Microsoft MVP, you are part of a highly select group of experts that represent technology’s best and brightest who share a deep commitment to community and a willingness to help others.

On behalf of everyone at Microsoft, thank you for your contributions to technical communities.


Thanks Microsoft for renewing my award this year, also thanks for my employer MetroStar System for continuous support in my community efforts.

Mostafa arafa

Wednesday, June 30, 2010

How to configure Reporting Services 2008 in SharePoint 2010

Hi All,

In This post i will show how to configure SQL Reporting services in SharePoint 2010.

If you have a SharePoint 2010 site and you navigate to site settings and try to click on "Managed Services Schedule" you will get this error:
Unsupported Reporting Services Functionality

This is because your SharePoint configuration is not configured with Reporting services server.

- To fix that, follow below steps:
1) Login to the Reporting Services server and make sure that the service is up and running, and double check that the reporting server is working:
a) Open SQL Reporting configuration manager
b) Select Report Manager Url.
c) click on the url to make sure it is working.
For example: http://SERVERNAME/Reports/

2) Open SharePoint Central administration:
a) Select General Application Settings.
b) Select Reporting Services Integration.
c) Set the report server url.
d) Select authentication mode, Windows if the reports show personalized data.
OR select the trusted account that will be used for impersonation.
e) Click on Ok, You will get a successful page.
f) You might get the following error:
"Failed to establish connection with report server. Verify the server URL is correct or review ULS logs for more information. Product area: SQL Server Reporting Services, Category: Configuration Pages"

This means that the SSRS is not configured to run with SharePoint Integrated Mode, to change it,read below article "Overview of Configuration Steps on a Report Server":

3) Go to your sharepoint site settings and enable Report Integration feature on site collection features.

4) Go to your site and add reporting services webpart in your page and configure it to your report.

Note: It is recommended to have a library that has all your reports in one place and all SQL Reporting services webparts are connecting to this library.

Happy SharePointing.... :)

Update [7/1/2010]: My friend @awsaxton On twitter- added this tip:
@MostafaElzoghbi On your SharePoint/RS blog, you may want to mention the need for SP1 CU7 to get RS 2008 to work with SP 2010.
Thanks Adam Saxton.

Mostafa arafa

Thursday, June 17, 2010

BreakRoleInheritance Common mistake Tip for SharePoint Developers

Hi All,

This post is to share with SharePoint folks/Developers one of the common mistakes that i caught while debugging and reviewing one of my projects. They system is using Custom List to store Data. and we set the permissions in C#, Here is how to set the permissions on item level permissions in SharePoint 2007:

// Define Role Assignment object.
groupRoleAssignment = new SPRoleAssignment(SPContext.Current.Web.CurrentUser);

// Define the Permission Level you would like to give.
SPRoleDefinition readControlDef = SPContext.Current.Site.RootWeb.RoleDefinitions["Read"];

//Add Permissions to the Role

//Add the item to your custom list.
SPListItem myItem = web.Lists[RFIListName].Items.Add();

// Break the inheritance to add your custom - Note this step

// Add Role assignment to the created item.


To check the permissions on the item level in SharePoint 2007, here is the code you need to write:

SPListItem item = MyBLL.getListItem(Id);
// Check if the user has permissions to edit the item
if (!item.DoesUserHavePermissions(SPBasePermissions.EditListItems))
{// the user doesn't have permission to edit the item, do something...

The check above was returning True, even if the user doesn't have Edit/Contribute permissions on the item.

Why ?! If you check the above function on this line:

True: means copy the permissions first, then my code add more custom permissions. and this is not what i want, i don't want to inherit any permissions from the site.

False: Means don't copy and i will handle the permissions by my self. and this is what i want.

The Developer who wrote above lines didn't read the description of the function, he thought that he wants to break the permissions by setting it to true.

Lessons learned, and this is the point i want to share it with all.

Hope this helps.

Mostafa arafa

Thursday, June 10, 2010

NOVA Code Camp 12 June @ Microsoft Reston Office

Hi Folks,

Next Event will be at Microsoft Reston,VA Office 12th June 2010, Organized and managed by Nova Code Camp Community.

Event will have the following topics: ASP.NET,C#,MVC,SharePoint,AZURE, Mobile Development,Silverlight and much more.

To check the schedule:

Speakers List:

I will be speaking in this event my session will be 2:45-4:00 PM and i will cover SharePoint 2010 Development and the following topics will be discussed:
1) VS 2010 Development tools for sharepoint developers.
2) Client Object Model vs. Server Object Model.
3) Sandbox solutions.
4) BCS in SharePoint 2010.

Have questions ? want to know more...come and attend my session.

Full day of technical topics on interesting top-notch technologies.

Follow Event updates: #NOVACC


Wednesday, June 09, 2010

SharePoint 2010 development errors and fixes

Hi Folks,

I want to share 2 errors i was getting while working with the ECMA Javascript Client Object Model in SharePoint 2010.

Error #!: only content controls are allowed directly in a content page that contains content controls. script

Why : when you have script block outside the content controls in your application pages in sharepoint 2010.

Add your Script block on the PlaceHolderAdditionalPageHead
In your application page.

Error #2: Cannot make a cache safe URL for "1033/sp.debug.js", file not found. Please verify that the file exists under the layouts directory.

Why this happen? Because SP.debug.js doesn't exist under layouts folder in sharepoint 2010.

Fix: Copy your SP.debug.js from this file path:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS

and paste it on the following directory:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1033

Hope this helps.

Mostafa arafa

Friday, May 28, 2010

Developing/Deploying ASP.NET Web Application in SharePoint 2007 under _layouts folder

Hi Folks,

This post i will walkthrough the steps required to create and deploy web application under _layouts folder in sharepoint 2007. Also note that this application is different than the MSDN article to build 2.0 website in sharepoint 2007, since this article only works if you copy the whole project ( with .cs files ) under website folder in layouts directory which is not recommended and not a best practice.

In this article i will go through the steps to create a web application with sharepoint master page and to deploy the web application dll in GAC as well.

1) Open your VS 2008, and select ASP.NET web application template.
2) Add Microsoft.Sharepoint.dll in your project references.
3) Create a folder in your project called _layouts, the purpose of this project is to have a dummy masterpage that let you develop your custom pages with sharepoint site master page and the pages will pick the site masterpage at runtime.
4) To get a dummy application.master, get it from this link:

5) Right click on your project to sign your assembly of the web application, since this dll will be in GAC.

6) Open the default.aspx page that you have and update the following:

<%@ Assembly Name="<span style="font-weight:bold;">ASSEMBLYNAME</span>, Version=, Culture=neutral, PublicKeyToken=<span style="font-weight:bold;">b1be248cde129fd5</span>" %>

<%@ Page Language="C#" AutoEventWireup="true"  Inherits="<span style="font-weight:bold;">NAMESPACE</span>._Default" MasterPageFile="~/_layouts/application.master" %>

<asp:Content ID="Content1" ContentPlaceHolderId="PlaceHolderMain" runat="server">


    Title of this site: <asp:Label ID="LabelTitle" runat="server" Text="Label">




<asp:Content ID="Content2"

ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server">

Test My ASP.NET Web Application


To download the sample page, here is the link:

Note: all your pages have to have 3 content controls that mimics the contentplaceholder that you have on your custom masterpage or sharepoint out of the box master page.

Tip: to get the public key token, just drag and drop your dll in GAC and right click on your assembly in your gac folder ( c:\windows\assembly) and you will get the public key token that you need to paste on all your pages.

7) To change the master page to your pages to the sharepoint master page, write the following method on your .cs file of your page:

protected override void OnPreInit(EventArgs e)

SPWeb Web = SPContext.Current.Web;
this.MasterPageFile = Web.MasterUrl;

8) One you are done, publish your website using publishing feature on your web application, right click on the web application and click on publish.

set the url of the web application to be under LAYOUTS folder in sharepoint.

9) Last, Deploy the web application dll file in GAC, you can create a feature for that, for development purposes, just drag and drop the webapplication.dll in your GAC under c:\windows\assembly folder.

10) Navigate to your test page and will see it works perfect, url for example :

Hope this helps.

Mostafa Arafa

Thursday, May 27, 2010

Update MSDN Article: Deploying ASP.NET Web Applications in the Windows SharePoint Services 3.0 _layouts Folder

Hi Folks,

In this post, I'd like to add more updates/Tips to the posted MSDN article with title:

"Deploying ASP.NET Web Applications in the Windows SharePoint Services 3.0 _layouts Folder"
Article url:

The article is going to work fine if you are building ( with limitations ) that is targeting .NET framework 2.0, if you are trying to build and follow the steps on an ASP.NET application that is targeting .NET Framework 3.0 or 3.5 ( specially if your application has AJAX and Silverlight modules on it) then here is the changes/Tips that you might tackle and change:

1) The article doesn't tell you how to have a page that's rendered correctly in your VS.NET while development, the trick on this, do the following:
a) create a folder in your application called _layouts, and copy the application.master file from LAYOUTS folder and paste it on _layouts folder.
b) Now the page will render correctly in VS.NET.
c) You won't be able to build your website since the application.master has a lot of usercontrols and components that doesn't exist in your application.
d) to fix this, simply remove all usercontrols that you have in the application.master and you then be able to compile and build your website.
e) we added application.master just because to have our pages render correctly in our VS.NET IDE and to enrich the design experience of our pages and user controls.
d) As a best practices, no need to hard code the master page name in your code, simply replace the code in the OnPreInit event to the following:

// Old code in the article:
SPWeb Web = SPContext.Current.Web;
string strUrl = Web.ServerRelativeUrl+"/catalogs/masterpage/GamePoint_ThemeBlueDefault.master";
this.MasterPageFile = strUrl;

// New code:
SPWeb Web = SPContext.Current.Web;
this.MasterPageFile = Web.MasterUrl;

The above code will assign the the site masterpage to the custom page. and no need to specify the name of the master page, and this add a major flexibility to your solution specially if you provide your client with different custom master page in your sharepoint site ( as in my case ).

2) The article is telling you just to comment the authentication section in the web.config, this is not true 100%, what you suppose to do is to remove any attribute that exist on the web.config of the sharepoint site otherwise you will get duplicate entry error. To fix this:

a) remove any duplicate entries on your web.config file from your application.

b) no need to have web.config in your site if you don't have any custom entries on your site. and in this case, your site will run under the configuration of the sharepoint site that exists in sharepoint site folder.

With these 2 tips you will be able to build any 2.0/3.0/3.5 application with no limitations and make use of the full functionality of VS.NET Design tools.

Hope this helps.

Mostafa arafa

Tuesday, May 25, 2010

SharePoint 2010 Master pages, Js, CSS tips

Hi All,

I want to share some ideas and tips on masterpage changes in regard of using Master pages, css and ribbons in Sharepoint 2010:

1) In sharepoint 2007, when you develop custom pages under _layouts folder, those pages doesn't take the site master page, you have to configure them in your solution to reference a customized master page. while in Sharepoint 2010 one of the good enhancements is that the site master page is applied on your custom pages under layouts folder. Good Feature to know.

2) To set the master page in your custom pages in SharePoint 2010 use the following lines of code:


This allow your pages to get the custom master page for the site, and if the referenced master page doesn't exists, the site will default to the default master page and then the site won't break.

IMMPORTANT Tip: by default MasterUrl and CustomMasterUrl set to "_catalogs/masterpage/default.master" and to change the default to have to set BOTH properties to your new master page.

3) You can start your custom master pages with minimal.master that you can download or use from sharepoint 2010.

4) V4.Master is a new master page in sharepoint 2010 and the default sharepoint 2010 master page user interface with Ribbon support.

5) Sharepoint 2010 javascript files has been enhanced, Microsoft split the js files into smaller minified files to be used on-demand only.

6) Sharepoint 2010 css files has been enhanced, Microsoft split the css files into smaller files that will be downloaded on-demand by any page.

7) To debug js files in Sharepoint 2010, what you need to do is modifying the web.config and adding the following attribute under system.web:

8) To add declaratively/dynamically (no code behind) the master page reference in your custom page based on the site selected master page:


9) As a best practice, it is recommended not to have more than 4-7 tabs in your Ribbon.

10) Ribbon doesn't support tables, all look and feel managed through css files, and the main css for the ribbon is called corev4.css

Hope this insights help.

-- Reference:
a) MSDN:

b) Professional SharePoint 2010 Development - Wrox

Mostafa arafa

Monday, May 24, 2010

NOVA Code Camp 12 June - MS Reston Office

Hello Everyone!

We have an impressive lineup of sessions you can see below. We have not yet made up a schedule, but we just wanted to let all of you know which of your talks were selected with plenty of time to prepare. We expect to have the schedule firmed-up by next weekend. We have some important details to share with you.

The Code Camp is on Saturday June 12th from 8:30am to 5:45pm at the Microsoft Office Facilities.

The address is:
12012 Sunset Hills Road, Reston, VA 20190

Ask the Experts
During lunch, we are running an Ask the Experts where you’re the experts! We will be grouping the speakers into four groups based upon session topic. Each group will then be able to entertain questions from attendees.

Speaker Dinner
We are holding a post-code camp dinner at Clyde’s in Reston. It’s within easy walking distance from the code camp. Please let me know if you will be attending so we can make reservations.

Speaker Selections
Please note if you received this e-mail, then at least one of your talks was selected. If you do not see your name on the list below, then please let me know.

Chagoury, Antonio Building an iPhone web app for your DotNetNuke module
Ames, Ned If Software Modules Were People
Blumenauer, John Building Extensible Silverlight Apps with MEF
Busse, Chris Promotion & Privacy (or lack thereof): Working with the new Facebook APIs
Cochran, Joel An Introduction to Expression Blend
del Mundo, Paolo Writing your first Windows 7 Phone App
Elzoghbi, Mostafa SharePoint 2010 Development
Griffin, Kevin jQuery From The Ground Up
Hazzard, Kevin Better Contracts. Better Code.
Hoerster, David Introduction to WCF Data Services and OData
Lele, Vishwas Architecting for Azure
Makogon, David Azure: The Essential Setup Guide
Michelotti, Steve ASP.NET MVC 2
Miller, John Building Facebook Apps with Windows Azure
Nguyen, Tuan Intro to BDD and SpecFlow
Rushdan, Habeeb Intro to Object Oriented Programming in .NET via C#
Schoolcraft, Jeff Rails FTW
Sizemore, John Source Control You Won't Hate: SVN and Git
Snowman, Geoff The Service Bus in the Sky - How to Connect Applications across Firewall Boundaries Using Windows Azure AppFabric
Van Lowe, Van Building Silverlight 4 Business Application Using WFC RIA Services

Thanks and we’ll be seeing you in just a short few weeks at NoVa Code Camp!

Sign up :

Latest updates: follow @novacodecamp or hashtag: #NOVACC

See you then !

Mostafa arafa

Tuesday, May 18, 2010

Access denied by business data connectivity


I was trying to create an external list in sharepoint 2010 and i was getting this error: "Access Denied by Business Data Connectivity" when i am trying to view the external list in my sharepoint 2010 site.

The fix for this problem is easy since the cause of this error is : The business data connectivity service is not configured in sharepoint- permissions are not set !

What we will do is to configure the BDC service by set the security permissions on it:

1) open central administrations.
2) select application management.
3) select business data connectivity service.
4) Hover on your application and select set permission from the menu.
5) Add users that will have the permissions to use this BDC Application and assign the required permissions.
6) Click Ok.

Refresh the external list and will works :)

Hope this helps.


Mostafa arafa

Monday, May 17, 2010

No confusion for SharePoint Project Templates in VS 2010

Hi Folks,

VS 2010 has shipped with wide variety of project types for developers, in this post i will clarify the use for the most common project types and items used for building sharepoint 2010 solutions:

1) Import Sharepoint solution package: this project template allows you to import existing wsp files that you developed before.

2) Import Reusable workflows: this template allows you to extend created/developed workflows using SPD in VS 2010. VS 2010 workflows provide more capabilities that doesn't exist in the SPD workflow designer. Once you are done, you can also deploy using VS 2010.

Note: once you modify the imported workflows from SPD you wont be able to open it back using SPD.

3) State Machine workflow: in this template you can create state machine workflows using VS 2010.

4) Application page: Use this page to add any pages in sharepoint sites.

5) User Control: this is a regular ascx user control that you can drag-drop it on your application pages.

6) Web part: this is a normal webpart that we use to develop since MOSS 2007.

7) Visual Web part: This is a visual webpart that you dont need to render it is interface, it contains a webpart and a usercontrol item.

Happy sharepointing.....

Mostafa arafa

SSO in SharePoint 2010

Hi Folks,

Single Sign On (SSO) one of the most important feature to connect to external systems from SharePoint, In SharePoint 2007 You have to configure SSO service and set the required username/password to connect to external systems.

In SharePoint 2010 the new name for SSO is SSS: Secure Store Service.

Here is some general consideration about SSS in SharePoint 2010:
1) SSS is a service in SharePoint 2010 that runs on the application server.
2) SSS provides a DB that store credentials for ApplicationIDs.
3) Application ID : is your token to access the external application, the token might represents one/group of users.
4) It is recommended to run SSS on separate application pool and on separate application server.
5) Use different SQL Server to store SSS credentials information.
6) You create SS Target Application Types:
a) Group: map group of people to access this external app.
b) Individual: map individuals to access this external app.

This is a general post about SSO - SSS, following posts will explain more....

Mostafa arafa

Thursday, May 13, 2010

Error connecting to a sharepoint list in PPS Designer

Hi All,

I was trying to connect to a sharepoint list in PPS designer 2010 and SharePoint 2010 and i'm getting this error:

I checked the eventlog and i found the following error:

The following data source cannot be used because PerformancePoint Services is not configured correctly.

Data source location: http://PORTAL/BI/Data Connections for PerformancePoint/1_.000
Data source name: New Data Source

The PerformancePoint Services Unattended Service Account is not set. The setting is located in "Manage service applications" in SharePoint Central Administration under the PerformancePoint Services management page.

I opened the central administration - > Application management and select manage service applications.

Select performance point services application and click on pps application settings link and try to set the secure store service (sss). set username and password and hit ok.

You might get this error message:

The Microsoft Secure Store Service application Secure Store Service failed to retrieve the master secret key. The error returned was: 'Unable to obtain master key.'. For more information, see the Microsoft SharePoint Products and Technologies Software Development Kit (SDK).

To fix it, go to the manage service applications and select secure store service and click on generate new key and ok.

Go back to the PPS and set the username/password PPS service account.

Hope this helps, happy sharepointing 2010 !!!

Mostafa arafa

Wednesday, May 12, 2010

Can't see Site collection features in SharePoint 2010

Hi All,

If you are trying to find out "site collection features" link in the site setting page in sharepoint 2010 and you couldn't find out the site administration section at all this is because the logged in user doesn't have a permission as a site collection administrator, open central administration site:

1) Select application management tab.
2) Click on change site collection administrators link under site collection tab.
3) add your self as site collection administrator.
4) refresh the site settings page and you will see all site collection administration section.

Hope this helps.

Mostafa arafa

Tuesday, May 11, 2010

File Not Found in SharePoint 2007

Hi All,

"File Not Found" is one of the most confusing errors that can be caused by a lot of reasons, In my case i have the site is up and running except my custom SharePoint 2007 pages under layout folder.

I developed a custom page which uses WCF REST API classes, and it is working fine on my development VM and once i moved wsp to the staging vm i was getting "File Not Found" and after turn off the customerrors and enable stacktrace in web.config, still i didn't get any details more than the method name that raises the error !!

After spending almost 2 hrs to figure out why some pages in my solution (wsp) is working and other they are not, I found that the pages that throw an error are using
Microsoft.Http.dll and Microsoft.Http.Extensions.dll that doesn't exist on the staging vm. and i remembered that those dlls are registered after you installed WCF REST started Kit.

The problem was missing an assembly and not a file !!!

To deploy those assemblies:
1) WCF assebmlies you can find them on the following path:

C:\Program Files\Microsoft WCF REST\WCF REST Starter Kit Preview 2\Assemblies

2)Copy both dlls:
Microsoft.Http.dll and Microsoft.Http.Extensions.dll

3) Add them to your wsp under GAC folder or drag and drop them to GAC.

Hope this helps.


Mostafa arafa

Monday, May 03, 2010

How to enable Session State in SharePoint 2010

Hi Folks,

If you are trying to use any of SharePoint 2010 Features that use Session state service in SharePoint, Then you need to enable session state service in SharePoint 2010 since it is disabled by default, Here is how to do it:

1) Open SharePoint 2010 Management Shell (As Administrator) and type the following command:


The shell will prompt you to enter the required DB name to store the session state data, type the database name.

Once you get the prompt back to you, You can check the created DB name, under sharepoint instance: SERVERNAME\SHAREPOINT to make sure the DB has been created.

2) Open the site web.config file and enable the session state on the site:


3) Reset IIS.

Check the feature or navigate to the site template that depends on session state ( For Example: Project Database site template) and will see it is working.

Hope it helps.

Mostafa Elzoghbi

Learn C# 4.0 By example and walkthrough

Hi All,

I'm writing this post to share with C# Developers and folks how to get to know C# New/Enhanced Features by examples by going through a well-prepared learning tutorials to start applying the new features by example:

1) C# 4.0 Code samples:

2) C# 4.0 walkthroughts:

I will post more examples in this blog about different usages/applications for the new C# 4.0 features that we were working on it with the product team.

Mostafa arafa

Tuesday, April 27, 2010

Working with Data in SharePoint 2010 - Part 1

Hi Folks,

I like to work with data since most of business applications are relying on consuming data from different data sources. This post is to highlight and give you the information or FAQ required to understand how to consume data in sharepoint 2010.

I had a presentation on my previous session on sharepoint saturday was talking about Data manipulation techniques in sharepoint 2010,check this url for details:

1) How can i consume data from sharepoint 2010 ?
You can consume data in sharepoint using different ways: either using the server object model Microsoft.SharePoint.dll in the following path:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI
Or using the Client object model: Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll

Note: if you are developing silverlight application, here is the path for the client object model for silverlight: microsoft.SharePoint.Client.Silverlight.dll and Microsoft.SharePoint.Silverlight.Runtime.dll
Path for the dlls:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\ClientBin

2) How Sharepoint 2010 is communicating with the client applications:
Clients are communicating in sharepoint 2010 using ADO.Net Data Services ( called also a RESTful API) that reside on the server and accept the requests from the client apps and respond to the requests in JSON objects.

3) What is the benefit of having Rest API ?
Restful API gives you flexible URLs and mutliple representation for the Data returned from the sharepoint server. Restful API is using WCF technology which supports Restful webservices starting from .NET 3.5.

Read more about Restful support in WCF in below link:

4) Which version of VS.NET IDE can i use to develop/consume restful webservices in SharePoint ?
You can use VS 2008 SP1 or VS 2010 and to add a reference to a restful webservice right click on your project and click on "Add Service Reference".

5) Why does Microsoft expose Client object model in SharePoint 2010 ?
Client Object model is a unified method across all client apps to consume sharepoint data: Silverlight Apps, Calling data from JavaScript and from .NET CLR Applications.

6) How can leverage the SharePoint data using LINQ ?
SharePoint 2010 supports LINQ out of the box, what you need to do is to use SPMETAL tool from the command prompt and point it to the required site to create stub from it and use this generated class in your application, then you are ready to use LINQ code from this generated class.

Hope this post helps in understanding working with sharepoint data.

Mostafa arafa

Monday, April 26, 2010

Tips on installing SharePoint 2010 RTM

Hi Folks,

When you try to install sharepoint 2010 RTM version, you might get some error messages while installing the SharePoint and once you have all updates for your windows 2008 SP2 / R2 and SQL 2008 SP1.

Here is some points to put into your consideration:

1) Before start installing SP 2010 by double click on setup.exe try to check your pre-requisites software required on your system.

2) You can install all your pre-requisites from this url:

3) After you download and install all required and start running SP 2010 RTM setup you might get this error message:

Error : This product requires Microsoft filter pack 2.0 sharepoint 2010 RTM

Even if you installed the Filter pack 2.0, you will get this error, to fix it you will find a folder in sharepoint 2010 folder called "PrerequisiteinstallerFiles" -> Filer Pack : inside this folder you will find filter pack 2.0 exe file.

4) Then run the following tool PrerequisiteInstaller.exe in the sharepoint 2010 installation folder and make sure you passed all required software to start installing SP 2010 RTM.

5) Run sharepoint setup file setup.exe.

You will have a successful setup and then you will run Sharepoint configuration wizard to complete the installation.

Hope this helps.

Regards,Mostafa arafa

Tuesday, April 20, 2010

SQL 2008 Troubleshooting Tip : "Mailbox unavailable. The server response was: 5.7.1 Client does not have permissions to send as this sender".

Hi Folks,

I was trying to send Emails using SSIS package deployed in SQL 2008. I was getting this error when i am trying to run the SQL Agent Job which sends Email address on the success of this job.

Error message in event log:
"Mailbox unavailable. The server response was: 5.7.1 Client does not have permissions to send as this sender".

To fix this problem check the following:

1) Check the service account for SQL Agent Service in your server.
2) Make sure the service account is a domain account, because if the system administrator doesn't allow to send emails for anonymous users, then this is one of the main reasons to get this error.
3) Don't forget to restart the SQL service agent if you changed the service account.
4) Inform your system administrator to add anonymous users with a new receive connector in Exchange, check this article:

5) Make sure in your SSIS Package you check use windows authentication checkbox in the SMTP Connection manager.

Hope this helps.

Mostafa arafa

Monday, April 12, 2010

VS 2010 and Silverlight 4 launch

Hi All,

Try to catch the VS 2010 and Silverlight 4 launch on channel 9.

Follow the updates on twitter: @ch9live

To watch the event online:


Mostafa arafa

Sunday, March 28, 2010

SharePoint 2010 Data Manipulation Techniques

Hi All,

27th March 2010 we had a successfull event of SharePoint Saturday - Arabia (@SPSArabia) hash tag in twitter, and event site url:

On this event we had more than +150 attendees and the quality of presenters was really hight, and the content is really fresh and new.

My session topic: SharePoint 2010 Data manipulation Techniques
"In this session will experiment different data manipulation techniques in SharePoint 2010 using server and client object model and the differences of using different model to query your data. Also, Using LINQ is one of the most favorite features for .NET developers in SharePoint 2010 and how can you retrieve master-details data in simple query in your code.

As i got the message from my attendees to post my slides and the solution for my demos.

Presentation url:

Solution Code for my demos:

Hope this helps and enjoy :)

Mostafa arafa

Monday, March 22, 2010

Asp.Net Script manager error with AjaxToolkit

Hi All,

I had an web application and after i installed the latest AJAX Toolkit from codeplex with build Beta (0911), i was getting this error:

throw new Error("AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts. Ensure the correct version of the scripts are referenced. If you are using an ASP.NET ScriptManager, switch to the AjaxScriptManager in System.Web.Ajax.dll, or use the ToolkitScriptManager in AjaxControlToolkit.dll.");

The problem because my script manager in the pages are refering to the script manager and not the toolkit script manager.


Delete all script managers you have and drag and drop a control named "ToolkitScriptManager" in your master pages or pages which script manager resides.

Hope it helps.

Mostafa arafa

Cloud computing in action presentation

Hi All,

Last week i presented "Cloud Computing in Action" presentation in Reston,VA. In this presentaion i talked about Azure cloud computing platform, and i covered the following topics:

- Windows Azure
- Windows Azure Storage.
- SQL Azure / SSMS / Storage Explorer
- AppFabric / Development Fabric
- Develop & Deploy Application on Azure using VS 2010 RC.
- Showcase for a full LOB ASP.NET application hosted on Azure.
- Q & A.

I like also to share my presnetation with all of you to make use of it.

Thanks to Dan Kasun to provide me good presentation and materials for Azure.

Hope it helps.

Mostafa arafa

Tuesday, March 16, 2010

Silverlight Application using SMF

Hi Folks,

Today i started to read about IIS smooth streaming feature available in IIS 7, and i am impressed with this feature, the feature simply provide you with the platform to provide HD videos in the application without writing a lot of code.

I started to read abou the feature on this link, Then i started to download the framework which is available in CodePlex:

It's pretty easy and innovative to have HD streaming in your application using this silverlight media framework.

**The full sample application is attached to be used as walkthrough.

Hope this helps and enjoy Silverlight.

Mostafa arafa

Tuesday, March 09, 2010

Cloud Computing Thoughts with Azure

Hi All,

Today i attended the Government Cloud Computing event at Washignton DC sponsored By Microsoft which held on Ronald Regan Conference center. I had cool conversation with the DPE team and Azure Technical guys in the event with some few business contacts in the Federal government Reps.

The event started with the Cloud computing vision on the furture and the challenges the face Microsoft and ISVs to engage the government to be open and approve the cloud computing solutions.

Then, Microsoft showed some show cases / Demos for implementing Windows Azure,Dallas and AppFabric with Blobs on the cloud.

Then we had a great panel that includes some of technology experts and innovators from the government and other private sector.

I really like the innovation in NASA and the CIO who was so open to the new technologies and how it helps NASA's mission and the scientific research that it has and how it helps them to reduce the operational cost for their IT services.

The event had 3 Tracks : Business Track, IT Track and Developer Track.

I will give my insights in the Developer track as bullet points:

- You can start developing Azure cloud computing with ZERO Dollar investment.
- Use VS 2008 with Azure training Kit to start developing cloud apps.
- ALL MSDN subscribers have a promotion from MS to have 750 hrs for 8 months FREE.
- Cloud Storage Studio is a free tool to manage your Azure Storage data.
- to get all public sector news.
- Accessing Cloud data using RESTful services using Odata protocol,
- is another tool to manage azure storage.
- SQL Azure migration wizard is an open source project in codeplex to migrate your DB to Azure compliant.
- MS Synch. Framework power pack for SQL Azure - Nov CTP to synch between different SQL Azure Databases and on premise DBs.
- Microsoft has a program called : Open government data initiative OGDI to expose data to the citizens using Azure technologies.
- OGDI provides toolkits with different programming languages to help developers to consume these data using Azure Platform.

These are my notes, hope it helps :)

Update: My page on the cloud :

Mostafa arafa

Monday, March 08, 2010

SharePoint Saturday Arabia - 27 March 2010

Dear All,

I'm really glad to announce that Registration is now open for participation in Live Online SharePoint Saturday Arabia. By registering for this event, you are confirming you would like to view the live presentations, presented from 7:00am to 4:00pm (GMT+0), on March 27, 2010.

In order to hear the presenters, you will need headphones or computer speakers. There will be no conference call dial-in phone numbers.

The live blogging platform will allow for real time questions to be passed to the presenters. There will be two sessions running simultaneously so that we can present to a diversified audience in both Arabic and English languages.

As you register, we would very much appreciate it if you would spread the word to your SharePoint colleagues. I have attached here the event poster, please feel free to use it.

Thank you for joining us. With your participation, we hope to make this an exceptional event.

الأعضاء الكرام تحية طيبة و بعد,
يسعدنا و يشرفنا أن نعلن أن باب التسجيل و المشاركة في Live Online SharePoint Saturday Arabia قد تم فتحه, بالتسجيل في هذا المؤتمر الافتراضي يمكنك مشاهدة المحاضرات و الشروحات أون لاين, المحاضرات ستعرض في تاريخ 27 مارس 2010 من الساعة 7:00 صباحاٌ حتى الساعة 4:00 مساءاٌ بتوقيت جرينتش.
هذا المؤتمر الافتراضي يعتبر الأول من نوعه حيث أنه ُيقدم شرح واف باللغة العربية و الانجليزية لشيربوينت 2007 و شيربوينت 2010 . لمشاهدة هذا المؤتمر لن تضطر للذهاب لأي مكان أو حتى دفع أي مبالغ مالية حيث أنه حدث مجاني و أون لاين, كل ما تحتاجه هو جهاز الكمبيوترو الدخول على شبكة الأنترنت.
نظام التدوين الحي يتيح لك طرح الأستفسارات والأسئلة على المتحدث في التو و اللحظة , و سيكون هناك محاضرتين في نفس الوقت حتى نتمكن من عرض المحاضرة على العديد من الجمهور باللغة العربية و الأنجليزية.
نشكرك جزيل الشكر للتسجيل, و الرجاء أن تبلغ أي شخص مهتم بتكنولوجيا الشيربوينت عن هذا الحدث, لقد أرفقنا الملصق الإعلاني للحدث, أستعمله كيفما تشاء.
نشكرك جزيل الشكر للأنضمام ألينا, و نتمنى أن يكون الحدث ممتاز و ممتع.
مع الشكر و الأحترام

Mostafa arafa

Tuesday, March 02, 2010

Microsoft Application Architecture Guide 2.0

Hi All,

Microsoft recently released the Application Architecture Guide version 2.0, This is a good resource to architect and design your solutions by applying Microsoft best practices in software design.


Hope it helps.

Mostafa arafa

Monday, February 22, 2010

Linq in Sharepoint 2010 Presentation

Hi All,

During attending MS MVP global summit from 16-19 Feb 2010, I present a MVP2MVP side session on Firday 4:40 pm, it was a great experience presenting to fellow MVPs.

I'd like to share my presentation with all to make use of it.

Note: All materials is applied on SharePoint 2010 Beta 2.

Presentation link:

Hope thish helps.

Mostafa arafa

Sunday, February 14, 2010

Error when using SPMetal in SharePoint 2010 with VS 2010 Beta 2


If you tried to create proxy classes using SPMetal command line tool in SharePoint 2010 using VS 2010 or the command line using this command:

SPMetal /web:http://MyServer:PORT:1000/TestSite /code:TestSite.cs

"The Web application at http://MYSITE could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application."

The solution for this problem after i spent almost 1 hour to figure out what is the problem,the problem is that your site doesn't get the username and password from the SPMetal tool, and you have to provide it in the command itself.

SPMetal /web:http://MyServer:PORT:1000/TestSite /code:TestSite.cs /username:DOMAIN\mostafa /password:testpassword123

Hope this helps.

Mostafa arafa

Monday, February 08, 2010

Error when enable publishing feature in SharePoint 2007


I was trying to enable publishing feature in sharepoint 2007, and i was getting this error:

Exception occurred. (Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION)) at Microsoft.SharePoint.Library.SPRequestInternalClass.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder)
at Microsoft.SharePoint.Library.SPRequest.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder)

The solution for this problem open stsadm tool and enable the following features:

stsadm -o activatefeature -filename publishing\feature.xml -url http://MyPortal -force

stsadm -o activatefeature -filename publishingresources\feature.xml -url http://MyPortal -force

stsadm -o activatefeature -filename publishingSite\feature.xml -url http://MyPortal -force

stsadm -o activatefeature -filename publishingweb\feature.xml -url http://MyPortal -force

stsadm -o activatefeature -filename publishinglayouts\feature.xml -url http://MyPortal -force

stsadm -o activatefeature -filename navigation\feature.xml -url http://MyPortal -force

Hope this helps :)

Mostafa arafa

Friday, February 05, 2010

Consume WCF and XML Web services using HTTPServices in Flex

Hi All,

I'd like to share with you this problem we faced in one of our projects, I was building a WCF/XML Web services Layer to be consumed by Mobile and Non-Microsoft Technologies such as FLEX / ColdFusion.

One of our team members was saying that when he was trying to consume our web services he wasn't able to get the results from our services layer.

I started to search why this happened only when when you try to get the data from a Flex Application, The solution is : the Flex only support HTTPServices and this means that the client only able to interact with the webservices either using HTTP GET or POST. and since web.config default configuration is : HTTP GET/POST is disabled by default and you will not be able to post parameters in the query string, here is the request from Flex:


What you need to do update the web.config by adding HTTP GET/POST protocols.


<add name="HttpGet"/>
<add name="HttpPost"/>

Hope this helps .Net and Flex developers all together.

Mostafa arafa

Wednesday, February 03, 2010

SharePoint Tip: Creating Custom web services in Sharepoint 2007


If you want to build your own custom Web services that will be hosted in a sharepoint instance, here is the complete walkthrough that you need to folow:

MSDN Article:

The tip is on step 12: if you didn't specify the assemblyname.classname you will not be able to successfully deploy your webservice.

Step 12 has to be :

WebService Language="C#" Class="MyServiceAssembly.Service, MyServiceAssembly, Version=, Culture=neutral, PublicKeyToken=8f2dca3c0f2d0131"

That's is and hope it helps.

Mostafa arafa

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.

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 :

Hope this helps :)

Mostafa arafa

Saturday, January 16, 2010

SharePoint Saturday Event - EMEA - 23 Jan

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:
List of Speakers:
List of Sessions:

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 :

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 :

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 ?

Mostafa arafa