Monday, December 16, 2013

Platform Not supported Exception when running Visual Studio Web Application

Hi All,

While i was developing a web application that creates an instance of a custom service application using Visual Studio 2013, I was getting this error:

Exception Type: PlatformNotSupportedException

Details:

Microsoft SharePoint is not supported in 32-bit process. Please verify that you are running in a 64-bit executable.


I have another SharePoint web part project that connects with no issues to the SharePoint custom service app, but this web application is throwing this exception! so, the error is related to the IIS express which is the default IIS for VS 2013 web projects.

The error will exist or be thrown when you create any SharePoint object such as: SPSite to connect and then implement your logic.

I googled little bit and i found that some blogs were saying to un check the prefer 23 bit under Build tab in the project properties, In my case this check is grayed out so i don't have the option to un check it.

In addition to that, by default all SharePoint projects or Web Projects are targeting AnyCPU, so you shouldn't change this specially if you are connecting or integrating with SharePoint.


The fix:
1) Right click on the web project that you are having this error and click on the web tab.
2) Under Servers, change the selection from IIS express to Local IIS, This will use the local IIS instance which is a 64 bit installation of your SharePoint Development machine.
- Note: This will allow VS 2013 to create a virtual directory and attach the process, so you will be able to debug once you hit F5.
3) Run you project, the code works with no exception when creating any SharePoint object such as a Site or Web...etc.

SharePoint Development Machine Configuration: Win Server 2008 R2 64 bit, VS 2013 latest release.

Happy SharePointg!!

Tuesday, December 03, 2013

Sorry, Something went wrong when deploying WCF service in SharePoint 2013

Hi,

While i was developing a RESTful WCF Service that is targeting SharePoint 2013 using VS 2013, I was getting the following "White" error page when i access the WCF service after deploying my project in VS 2013.




As shows in the above screen shot, The error is related to getting and loading the right assembly for my WCF service class type, I know the GUID in my WCF class is matching the GUID in the svc file. But what is the problem ?

I found out that the solution for this problem is SharePoint doesn't accept the upper case letters in the GUID.

This was my GUID:  CDCC536B-37BB-4CC3-BF20-263AB66926D5

I changed the GUID by replacing the upper case characters to lower case characters in the Service class and in the SVC file, then save and deploy! It works!

Happy SharePointing!


Sunday, December 01, 2013

HTTP 500 error when you login in Joomla as an administrator

Hi All,

I was trying to install and configure one of the most popular open source CMS Joomla 3.2. After i installed and configured my first site, I was getting HTTP 500 error when i log in as administrator from the site.

I checked and i found that the super user is created in the database and the username/password has permissions to access the created DB for the site but i can not log in to the CMS site as a super user or administrator!

I check the configuration.php and web.config and i found the following http handlers has been added in the web.config file by IIS.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <directoryBrowse enabled="true" />
        <handlers accessPolicy="Read, Execute, Script">
            <remove name="PHP55_via_FastCGI" />
            <add name="PHP55_via_FastCGI" path="*.php" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\PHP\v5.5\php-cgi.exe" resourceType="Either" requireAccess="Script" />
        </handlers>
    </system.webServer>
</configuration>


I have installed and configured PHP 5.5 using IIS 7.5 in Windows 8 but i do not know why the IIS has added the highlighted entries in the web.config.

The fix, is to remove the PHP http handlers from the web.config and the log in will start working like a charm !

Hope this helps.
- ME

Thursday, November 14, 2013

Where is Microsoft.SharePoint.ApplicationPages.Administration.dll in SharePoint 2013

Hi,

If you are developing custom application pages in SharePoint Central Administration, you will be in need to add this reference in your project, Here is the path for this dll:

c:\program files\common files\microsoft shared\web server extensions\15\CONFIG\ADMINBIN

Enjoy!

Monday, November 04, 2013

You do not have the necessary permissions to change the domain logon for this user

Hi,

While i was importing a Microsoft Dynamics CRM 2011 solution i was getting this error message:

"You do not have the necessary permissions to change the domain logon for this user"


The Service account that is running the CRM Server App pool is a member of the Administrator group, and a member of deployment administrators group. So what is missing ?

It turned into that the service account does not have the permissions to a certain folder that is being used by MS CRM Server 2011 for imported solutions, here is the folder path:

c:\program files\ Microsoft Dynamics CRM\CustomizationImport

Add the service account to have full access to this folder and then you will be able to import your custom solution in CRM.

Hope this help.

Thursday, October 31, 2013

Exit Code: 5100 while installing CRM 2011

Hi,

While i was installing a MS CRM 2011 on a Windows Server 2008 R2 VM, the installation was hanging or taking forever after i accept the license agreement. checked the logs and this is what i found:


Since my Machine did have SQL 2012 and VS 2013 so VC++ 10 x86 & x64 were installed on my machine and that was the reason for the hanging issue while the installer is trying to install these components on my machine.

Some blogs will be saying the following and this is WRONG because it will break your SQL 2012 installation and you will not be able to open SQL Server 2012 or continue your CRM 2011 installation because you don't have a running instance of SQL server.

DO NOT DO THIS : "Un install all VC++ components from your machine and then re-run the installer, you will notice it wouldn't take a second to move from the license agreement page to the prerequisites form next."

The solution is to have an updated installer from Microsoft to fix this glitch when you have a VM with SQL 2012 pre-installed on it and it contains VC++ components installed.

KB about this issue: http://support.microsoft.com/kb/2686619/en-us

Get an updated installer from the below link:
http://www.microsoft.com/en-us/download/details.aspx?id=27822


Hope this helps.

Friday, October 18, 2013

Tips and Tricks on NuGet Packaging for .NET Developers

Hi,

Recently i have the chance to work NuGet, NuGet is an open source Packaging Server and set of tools that you can use to package your work within an organization for distribution or publicly upload your packages to nuget.org to be utilized by all developers.

First, You need to create a website to be accessible by all developers, and then upload or install NuGet server package to it. NuGet Server at the end of the day is a website that holds all your packages.

To host your NuGet Packages in a server:

1) Open your VS 2012 or 2013 and then create an empty web application.
2) Open the Package Console window and install-Package NuGet.Server, this command will install all server components.
3) By Default, you can once you know how to create nuget packages, you need to push it to the packages folder that will be created for your once you install the NuGet Server packages.
4) There are some cool features once you open the web.config, such as the key you need to publish nuget packages.
5) Basically, that's all from the server perspective.

Second, you need to know how to author or design nuget packages, what you need to do, install the Nuget Package Explorer from this url: http://npe.codeplex.com/

Once you install this ClickOnce Windows Application, you will be able to create, design and deploy nuget to the server we just mentioned earlier.

Some tips to create nuget packages using NuGet Package Explorer:
1) You have to set all your dlls in the lib folder, since all these dlls will be added to the references once you install the package.
2) To add the lib folder to your package, right click on the right pane and then select lib folder.
3) You can add dlls to your lib folder by dragging and dropping the dlls to the lib folder in the right pane.
4) You can set any content under content folder such as: images or any required files are needed for any application to utilize your nuget packages.

5) Under lib folder you can different target .NET frameworks such as: .NET 4.0, .NET 4.5



6) The nuget is referring to the target .NET frameworks as follows: net40 to refer to .NET 4.0 and net45 referring to .NET 4.5.
7) Once you save all your referencing dlls, content and .net & nuget packages dependencies, you just need to save the nuget file and then from the file menu item publish to the nuget server.
8) You can even add powershell files when you install, un install and when every time you open VS project which is the purpose of init.ps1.



NuGet Documentation: http://docs.nuget.org/

Hope this helps, let me know if you have any questions.


Wednesday, October 02, 2013

Verify that this binding extension is properly registered in system.serviceModel/extensions/bindingExtensions when deploying a WCF on Windows Azure

Hi,

I was deploying a WCF service on windows azure, after deploying it and then when i was trying to connect to the end point i was getting this exception:


System.Configuration.ConfigurationErrorsException: Configuration binding extension 'system.serviceModel/bindings/basicHttpsBinding' could not be found. Verify that this binding extension is properly registered in system.serviceModel/extensions/bindingExtensions and that it is spelled correctly.

I thought it is something related to some missing configuration that i need to do on Azure even though the WCF is working fine on my development box. It turned to something simple you need to add on your web.config and it fixed the issue.

Add targetFramework="4.5" to the httpRuntime element in your web.config


Refresh the WCF end point page, you will be able to access and see the WSDL file for your WCF.

enjoy!

Sunday, September 29, 2013

Principal User is missing prvReadSolution privilege in CRM 2011 using VS 2012

Hi,

I was working with the latest CRM 2011 SDK using VS 2012 and when i was creating a workflow for MS Dynamics CRM, i got an error while trying to connect to the CRM. Here is the error message:



Principal User is missing prvReadSolution privilege


To fix the problem, follow below steps:
1) Login to your CRM.
2) Select Settings tab.
3) Click on Administration and then click on the Security Roles icon, or if you assigned the permissions to the user directly then open the permissions tab for the user you are using to login to the CRM from VS 2012.
4) Click on the customization tab.
5) Look for the solution list item and set the read permissions only.



6) Click on Save and Close.
7) Try to connect from VS 2012, you will be able to connect with no issues.

Hope this helps.

Sunday, September 15, 2013

One or more errors occurred while processing template 'Entity.tt'. Using Reverse Engineer Code First in VS 2012 Update 1

Hi,

Using VS 2012 Update 1, I was doing some changes in my database schema and when i try to reverse engineer code first my updates i was getting the following error:

One or more errors occurred while processing template 'Entity.tt'.

In the output window, VS listed that System.Xml and System.Xml.Linq exist on 2 different paths, one where the .NET framework is installed and the other one is pointing to the Siliverlight 5 DLLs in the GAC.

While it is reported as a bug in Microsoft Connect website, I was trying to remove the link to the Silverlight 5 Dlls that i'm not in need when i reverse engineer code first my EF files to apply my DB changes.

To fix this problem: 
1) Open the following directory:

C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes

2) Take a backup from EF.Utility.CS.ttinclude or the VB version based on the your project language you are using.

3) Open the notepad in an administrator mode.

4) Open the CS.ttinclude file.

5) change the following 2 lines:

<#@ assembly name="System.Xml" #>
Change it to:
<#@ assembly name="System.Xml, Version 4.0.0.0, Culture=neutral" #>

<#@ assembly name="System.Xml.Linq"#>
Change it to:
<#@ assembly name="System.Xml.Linq, Version 4.0.0.0, Culture=neutral"#>

6) Save the file.

7) Right click on the project that has the EF files and click on Reverse engineer Code First.

8) bingo! you will get your database updates with no errors.


Let me know if you have any issues with this.

Thursday, September 12, 2013

Tips on SharePoint 2013 Branding and UX Design

Hi All,

I had the opportunity to work with SharePoint 2013 Branding and building new UX related components such as: Master Pages, Page Layouts and Content Types development on a SharePoint 365 site or SharePoint 2013.

I found some interesting tips and tricks and i'd like to combine them all in this blog post for End Users, Designers, Architects and anyone who works in SP branding and customization.

Here are some general information and tips to know ahead before getting in creating new UX SharePoint components:

1) If you are new to SharePoint and you want to understand how MasterPages are connected to page layouts and actual pages, I recommend reading this article first:
http://msdn.microsoft.com/en-us/library/jj191506.aspx

2) In SharePoint 2013, You can create your master page in any html editor --> sweet!
3) Once you are signed off on the new look and feel of the new master page in HTML, A good option: you can map the new master page in html with all related javascript and CSS files to the SharePoint Master page gallery, Here is how to do it:
http://msdn.microsoft.com/en-us/library/jj733519.aspx

4) Another option is: you can directly convert the html master page to an actual master page; where SharePoint will create a new file with .master extension and add SharePoint attributes and place holders used by SharePoint, here are the steps using the design manager:
http://msdn.microsoft.com/en-us/library/jj822370.aspx

5) Design Manager is a new feature in the publishing sites, you can use it to brand public facing SharePoint sites and Office 365 sites. Read an overview about How to use Design Manager in SharePoint 2013:
http://msdn.microsoft.com/en-us/library/jj822363.aspx

6) Once you create your new master page, you might need to create new set of page layouts that provide nicer UX to your visitors, This article shows how to create new page layouts in SharePoint 2013 and office 365:
http://msdn.microsoft.com/en-us/library/jj822368.aspx

7) If you want to have different UX for Mobile and tablet users, you should create different channels aka different master pages and page layouts for different targeted devices, this article describes how to implement this in your site:
http://msdn.microsoft.com/en-us/library/jj862343.aspx


Hope this helps, drop me a line if you have any questions or clarifications.



Reference:
- Build Sites for SharePoint 2013:
http://msdn.microsoft.com/en-us/library/jj163242.aspx


Monday, August 05, 2013

SharePoint 2013 Strategy client object model (CSOM) tips


Hi Folks,


I have consolidated some useful tips about CSOM in SharePoint 2013 from training vidoes i found on MSDN and i decided to put it on a blog post so it is easier and faster to get your notes out of them.


1)      In SharePoint 2010, you can’t access client.svc to conduct client calls to SharePoint Object model, instead you use .NET, Silverlight, or JavaScript client library to conduct client call to the WCF client.svc on the server from your client applications.

2)      In SharePoint 2013, you can directly access client.svc from REST clients.

3)      In SharePoint 2013, Client.svc accepts HTTP verbs such as: GET, POST , PUT.

4)      Extended CSOM API that supports more functionality such as: Search, Taxonomy, Publishing, Analytics, Workflow and E-Discovery.

5)      “_api” is a new alias for “_vti_bin/client.svc” to access the end point.

6)      CSOM code in SharePoint 2010 should be migrated to SharePoint 2013 CSOM with no issues.

7)      ListData.svc still available for backward compatibility applications from SharePoint 2010 into SharePoint 2013.

8)      It is not recommended to use ListData.svc in your SharePoint 2013 CSOM code, Use OData API instead, check #12.

9)      You can use fiddler to monitor client queries in CSOM code, especially when you call ExecuteQuery() in CSOM code.

10)   Using IE developer tool and Fiddler are essential when you code using JavaScript to call sp.js in CSOM. It also allows seeing the details of the request and JSON response content.

11)   FormDigest is being created the first time when calling ExecuteQuery for the first time; this is being used on all consecutive calls.

12)   Simply OData URIs as follows to access the web:


Simplified: http://www.contoso.com/_api/web

To access “Announcements” list:


Hope this notes would help.




Reference:
SharePoint 2013 CSOM and OData API Training Videos
 

Tuesday, July 23, 2013

Fix It: 3 steps to show your SSRS report header in all pages while scrolling

Hi Folks,

I'm writing this blog about a tip i spent some time to fix in one of my SSRS reports. The issue is that i have my header is visible while i'm scrolling but only in the first page. I want the header to show in all report pages and not just the first page.

I didn't find a resource or MSDN article to resolve this issue but i tried the old technique "try and error" until i found a resolution for it and then i have my header is showing while i'm scrolling in all my report pages.

The case:
You have a tablix in your report with header, you want to keep the header visible while scrolling in all pages.

The solution is in 3 steps:

1) Set "FixedData" property for each header column to True.  Here is how to do it:
     http://msdn.microsoft.com/en-us/library/dd220509.aspx

2) Now, If you previewed the report, you would see the header is visible while scrolling!!, here comes the trick, Select the (Static) item from the Row Groups right pane and open the properties window.



3) Set the following properties to True:
   Set FixedData, RepeatOnNewPage properties to True
   Set KeepWithGroup property to After

Now, Preview your report from VS 2012 SSDT or BIDS and you will see that you have visible column in all report pages!

Enjoy!
 

Wednesday, July 17, 2013

What’s new in Records Management and Compliance in SharePoint 2013


Hi Folks,
I’m writing this article about what’s new in Records Management and Compliance in SharePoint 2013. SharePoint 2013 has extended the retention policies to be applied on the site level!.

Having the site retention policies on the site level is a cool feature, especially for most of the small/medium organizations that creates sites for their departments and not site collections.

Another cool feature which is the site policy also applies on SharePoint 2013 Foundation, so you can apply your site retention polices if you have SP 2012 Foundation instance.

Site Level Retention:

You can manage retention policies to SP sites and exchange 2013 team mailboxes that are associated with the sites.

Compliance officers create policies, which define the following:

n  The retention policy for the site and the associated exchange team mailbox, if any is associated.

n  What causes the project to be closed?

n  When a project should expire.

Here are the steps to apply compliance and retention policies:

1)      The site owner creates a SharePoint site.

2)      The site owner creates an exchange server 2013 team mailbox.

3)      The site owner assigns/selects the appropriate retention policy template.

4)      The site owner invites team members to join the site.

5)      All emails and documents among the site team members, the selected policy will be applied.

6)      When the project is completed, the site owner closes the project.

7)      Once the project is closed by the site owner, all project folders in outlook 2013 User Interface will be removed.

8)      When the project expires as per the selected policy, all associated artifacts to this project will be deleted.

 Hope this helps.

Useful Urls:

** Overview of site permissions in SharePoint 2013


 

 

Monday, June 24, 2013

New BCS Enhancements in on-premise and online SharePoint 2013

Hi Folks,

I'm writing this blog to list the new BCS features and enhancements in SharePoint 2013. SharePoint 2013 is released with great features for developers and IT Admins in terms of ease of use connecting to external sources and the ability to develop self-contained SharePoint applications that connect to external sources. In this article i will describe the new features and enhancements when building solutions on top of SharePoint 2013.

BCS enhancements in on-premise SharePoint 2013:

1) Automatic generation for BDC Models for OData data sources:
In SharePoint 2013, you are able to connect to OData endpoints and generate BDC models. You must use Visual Studio 2010 to create BDC models for OData data sources.
Then you can import these models in BDC Catalog on your farm-scoed external content types or added on a SharePoint App. VS 2010 will generate  BCS operations for all OData Operations (Get, Put, Post and Delete).

2) The ability to create SharePoint App-Scoed External Content Type:
When creating BDC models in VS 2010, you will be able to add App-Scoped external content types that will be used only on the associated SharePoint App.

3) Performance improvements in external lists:
SharePoint 2013 has introduced new enhancements and improvements to minimize the load on the database servers in the SharePoint farm and by increasing the speed of list rendering.
The ability to perform paging, filtering, and sorting of the external list data before it is sent to SharePoint is a great feature.

4) Limiting the records returned by external system:
In the BDC model, users can specify the number of records in the list that they want displayer per page.

5) Data Source Filtering, Sorting and export to excel:
In SharePoint 2013 you are able to filter and sort the data exposed through the an external list. So, in this case the external system filter and sort the data before send it back to the external list.
Also, you can export an external list to excel and in this case you get all list content and structure it shows in the browser.

BCS enhancements in SharePoint Online:

1) REST (CSOM): REST Api is available for web and mobile devlopers to consume SharePoint data using Client Obect Model for the REST Api.

2) BCS Client runtime supports side by side Office 2010 and Office 2013 installaion.

Hope this helps.

-Mostafa Elzoghbi

Thursday, June 20, 2013

Understanding Crawl and Index components interactions in SharePoint 2013 - Part 1

Hi,

I’m writing this post to describe the main components in SharePoint 2013 Search and related components.
As you know, SharePoint 2013 has a slight change in Search components than SharePoint 2010 since they re-architected search components and their dependencies from the previous version.
I will explain the purpose of the 4 main components (marked with asterisk below) so it will be easier to understand and help you when you plan for your SharePoint Farm deployment since Search is a crucial component to scale for SharePoint collaboration and user adoption.

Main SharePoint 2013 Search Components:

1)      Crawl component*.

2)      Content Processing component*.

3)      Analytics processing component.

4)      Index component*.

5)      Query Processing component*.

6)      Search Administration component.

*These components are covered in this article.

SharePoint 2013 Databases:

1)      Crawl database.

2)      Link database.

3)      Analytics reporting database.

4)      Search Administration database.

First and foremost, is to understand the Crawl components interaction, here I will talk about 3 main components:

a)      Crawl Component

b)      Content Processing component

c)       Crawl database

n  Crawl component: The crawl component is responsible for crawling content sources. It delivers crawled items – both the actual content as well as their associated metadata – to the content processing component.

The crawl component invokes connectors or protocol handlers that interact with content sources to retrieve data. Multiple crawl components can be deployed to crawl simultaneously.

Note: The crawl component uses one or more crawl databases to temporarily store information about crawled items and to track crawl history.

n  Crawl database: The crawl database contains detailed tracking and historical information about crawled items. This database holds information such as the last crawl time, the last crawl ID and the type of update during the last crawl.

n  Content processing component: The content processing component is placed between the crawl component and the index component. It processes crawled items and feeds these items to the index component.

The content processing component transforms crawled items into artifacts that can be included in the search index by carrying out operations such as document parsing and property mapping.

Both the content processing component and the query processing component perform linguistics processing. Examples of linguistics processing during content processing are language detection and entity extraction.· The content processing component writes information about links and URLs to the link database.

 Below shows the dependency data flow between Crawl and Index components:

Crawl Component àStore à Crawl DB àFetch/Process crawled items

à Content processing àcontent processing & extractionà Index Component

Second, once the data has been processed to Index Component, The next step contains other 3 main components are interacting to provide search capability in SharePoint:

a)      Index Component

b)      Index Partition

c)       Query Processing Component

 n  Index component: An index component is the logical representation of an index replica.

In the search architecture, you have to provision one index component for each index replica.

The index component receives processed items from the content processing component and writes those items to an index file.

The index component receives queries from the query processing component and provides results sets in return.

Queries are sent to the index replicas through the query processing component. The system routes and load balances the incoming queries to the index replicas.

 
n  Index partition: An index partition is a logical portion of the entire search index.

The search index is the aggregation of all index partitions.

n  Query processing component: The query processing component is between the search front-end and the index component.

The query processing component analyzes and processes search queries and results.

Both the query processing component and the content processing component perform linguistics processing. Examples of linguistics processing during query processing are word-breaking and stemming.

When the query processing component receives a query from the search front-end, it analyzes and processes the query to attempt to optimize precision, recall, and relevancy. The processed query is then submitted to the index component.

The index component returns a result set based on the processed query back to the query processing component, which in turn processes that result set before sending it back to the search front-end.
 
 
 
There are my thoughts on the main Search interacting components in SharePoint 2013, Drop me a line if you have any additions or questions.
 
 
-ME
 

Thursday, June 13, 2013

How to set parameters' values to SSIS packages

Hi,

This post to walkthrough step-by-step how to pass parameters to a SSIS package.
Usually you have set of parameters and you want to set the values at run time before the package runs.

The methodology that i will implement in this post, is to export the parameters that i want to set from an XML file by defining the SSIS configuration file using Visual Studio BIDS 2008/2010 or SQL Data tools.

Let's say, you have a SSIS package with a parameter called @myParameter, Here is how to setup the configuration file for the SSIS so we can pass it when the package runs.

Steps:
1) Open yout SSIS package.
2) Right click after you open the package and select on "Package Configurations".




 


3) Set the configuration file name and click on Next button.



4) Under Variables node, select the parameter name "@myParameter" you want to export to the configuration file, then click on Next button.
5) Write a name for the configuration and click on next.
6) The VS BIDS will create a XML file with the exported parameter properties.
7) open "TestPackage.dtsConfig" using the notepad and set the value property for the exported parameter.
8) Change the value of the parameter value in the dtsConfig and then save the file.
9) Run your package and the SSIS package will get the updated value from the xml file.

Hope this helps.


 

Wednesday, June 12, 2013

Windows Phone 8 Get Started and in-depth topics - TechEd NA 2013

Hi everyone,

If you haven't attended TechEd North America 2013 and you are a windows phone developer, This blog post is for you.

I was looking to see all windows phone 8 sessions so i can check them on my own time, I found this blog post that has all videos for windows phone 8 in TechEd 2013.

Take a look and enjoy.


http://blogs.windows.com/windows_phone/b/wpdev/archive/2013/06/06/teched-north-america-2013-summary.aspx

-ME

Tuesday, June 04, 2013

SharePoint 2013 REST Service Integration versus Client Object Model

 
Hi Folks,
Microsoft has released REST service in SharePoint 2013. As a SharePoint solution architect/developer you will be having more than one option to manipulate SharePoint data in your client applications.
 
With the REST interface in SharePoint 2013, folks are asking about what are the differences? And what are the benefits over each other? I will list all my insights in points in this blog post.
 
1) One of the main differences between Client Object Model API (COM) than REST API that it requires SharePoint Client assemblies that's only available for .NET technologies. While using the REST API doesn't require any .NET assemblies to be referenced in your client application but use any programming language to execute standard HTTP requests. For example: use the REST API to access SharePoint 2013 from your PHP website or iPhone/Android App.
 
2) What if I want to consume SharePoint 2013 data with Mobile Applications?
If you are planning to consume SharePoint 2013 data through using iOS or Android devices, then the REST API is the way to go. While if you are developing SharePoint 2013 solution on a windows phone 8 then still you have 2 options either REST or Client Object Model while I recommend to go with the REST for portability and code-reuse purposes specially if you plan to have different version of your application in iOS & Android platforms.
3) Benefits of using REST over COM in Mobile apps? The size of your application will be smaller when you use REST since you don’t need to add any assemblies in your App.
4) What about Windows 8 Apps? If you are developing HTML5 & JavaScript Windows 8 App this requires using the REST API in SharePoint 2013.
5) How do you Access SharePoint 2013 REST API?
The REST API is a WCF services hosted on the SharePoint Application server and has HTTP endpoint; you can access it through the following URL:
If you want to access a site collection:  http://MySite/site/_api/
If you want to access a web site:  http://MySite/site/_api/web/
To do the basic CRUD operations, check out this article:
 
“Get started with the SharePoint 2013 REST service”
“Using the SharePoint 2013 REST service”
6) When you read the above MSDN articles, the sample requires you to get an access token to access SharePoint 2013 REST API, Is there an alternative?
The answer is yes, you can access the REST API without getting an access token by using the Cross-Domain JavaScript Library. Here is your complete reference to code this.
7) The REST API is not just available for Site Collections and Site scope CRUD operations but it is also available on BCS, Search, and Social Features in SharePoint 2013. Check out these urls:
a) Using BCS REST service:
            b) Using Search REST service:
c) Using Social Features REST service:
As a solution Architect and Web guy, I’m so excited with the SharePoint 2013 REST API. It is a great shift to the web standards and to eliminate the boundaries to integrate SharePoint with Non-Microsoft platforms and tools.
I see this API will be primarily and heavily used by Mobile Developers and System integrators toward SharePoint Hybrid Solutions.
Hope this helps.
 
 
 

Thursday, May 09, 2013

Microsoft.ReportViewer.Common.dll is missing!

Hi Folks,

If you are having ASP.NET web application that is using Report Viewer control, you should be having the following dlls on your machine:

Microsoft.ReportViewer.WebForms.dll
Microsoft.ReportViewer.Common.dll

The first dll, has to be added as a reference in your bin directory while the second one can reside in GAC.

You probably will be getting an error if you don't have the common dll on your machine, first, first check the GAC:  C:\Windows\assembly

If you don't have it, then you need to install Report Viewer Redistributable package.

Here you have to note that the version of the dll will vary based on the installer version.

If you want version 10, you have to install VS 2010 release, here is the link:
http://www.microsoft.com/en-ie/download/details.aspx?id=6610

If you want version 09.00.21022.08 of the dll, you need to install VS 2008 release:
http://www.microsoft.com/en-us/download/details.aspx?id=6576

If you want version 8 of the dll, you need to install VS 2005 release:
http://www.microsoft.com/en-us/download/details.aspx?id=6219


Hope this helps.

Tuesday, May 07, 2013

Import SSIS package error 0xC0010014 when importing SSIS package

Hi Folks,

I'm writing this blog post to share an interesting find while i was developing a SSIS package using VS 2012 with BI tools. Microsoft has release on March this year 2013 BI tools to VS 2012 so you don't need to use VS2010 shell while developing SSIS packages.

The download link for BI tools in VS 2012 is here:
http://msdn.microsoft.com/en-us/library/jj856966.aspx

After i developed my SSIS package and try to deploy it on the SQL Server 2008 R2. I was getting the following error message when importing the package, here is the screen shots:

 
If you are using the Management studio you will get this above error without details!, but to get the detailed error message use SSIS Execute Package Utility, you can launch it from SQL SERVER 2008 R2 --> Integration Services --> SSIS execute Package utility
.


If you read the actual error message it says:
Package Migration from Version 6 to Version 3 failed with error 0xC001700A

Basically the Version that i used to develop the SSIS is higher than the recognized version by the SQL Server 2008 R2. To fix this problem you need to change the package version from 6 to 3 and it works like a charm!

Follow the following steps:
1) Right clich on our dtsx file and select edit, Open the file in notepad.
2) Look for:

      DTS:Name="PackageFormatVersion">6

3) Change the number 6 for the version to 3 and save the file.
4) Select the File System File from the SSIS execute utility and you will not get any errors!
6) From the management studio you can import the SSIS with no errors.

Hope this helps.

[Update 05/09/2013] You will run through other issues if you used VS 2012 SQL Data tools against SQL Server 2008 R2, one of them is the sql job agent will fail to run the imported job due to the xml format mismatch while executing the package. So, it is recommended to develop any SSIS SQL2008 R2 components using the old BIDS VS 2008.


-ME
 

Monday, May 06, 2013

How to convert your WCF Service Library to WCF Service Application

Hi Folks,

If you have a WCF Service Library Project in VS 2012 and after you wrote some functional code and then you decided to change the project from a WCF Service Library that doesn't contain web configurations and can't be hosted in the IIS to a WCF service application that is hosted in IIS, this blog post will tell you how to do it in details.

The WCF service library doesn't contains the Web Configuration Tab when you open the project configuration (By right click on the project --> Project Properties) and it has only app.config file and not web.config file because it is not suppose to be hosted in the IIS.

To change your WCF service library to WCF Service Application:

1) Right click on the wcf project and click on unload project.
2) After the project is being unloaded, right click on the wcf project and click edit the project configuration file ".csproj".
3) Look for the following attribute :

 {3D9AD99F-2412-4246-B90B-4EAA41C64699};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}

Change the project type to the following:

{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}

4) Reload the project.
5) Open the project configuration, you will be able to see the web tab to configure the wcf service.
6) Add web.cofig file to your project.
7) Copy any necassary keys from the app.config to the web.config.
8) Rename or delete the app.config file.
9) Make sure that you have correct port and end point configuration in the web.config.
10) Clean and Build your project. At this point the project is build with no errors.

After you run the project you will see that there is no .svc file that is the service application file used to call the WCF. But you need to have one in your project.

11) First Rename your Service.cs and IService.cs.
12) Add new WCF Service svc to your project and name it as you like.
13) Copy the code you have in the Service Class and the interface to the newly created service.
14) Compile the project.
15) Run the WCF Service application and now your WCF can be accessed through the web.


Note:
This works with VS 2012 project templates with Update 2 as well.

Hope this helps.



 

Tuesday, April 16, 2013

Few tips to know when considering developing MVC4 Applications in VS 2012 - Part 1

Hi Folks,

I'm writing this blog post for ASP.NET web forms developers who have been working with Web forms for years and they are hesitant to develop MVC 4 ASP.NET applications; maybe for different reasons either it is not easy to understand or there are a lot of things you need to wrap your head around to get started building your first business application!

So i decided to write these series of posts,I will try to makes it easier for you to get started in MVC 4 applications with few tips that will help you know how it works and some other considerations to think about.

1) Basic Concepts of the MVC design pattern:
In MVC design pattern implementation by Microsoft, any page you see in the browser is a view, it can be a page or a user control. it can be aspx,ascx or cshtml. MVC has introduced cshtml which is the new render engine called RAZOR, this engine allows you to wirte cs code within your html elements by prefexing any C# Code by @ symbol. For example:
 
<div>@Html.ActionLink("Home", "Index", "Home")</div>

The above line is rendered by Razor as a link with a caption called Home and Index is the method will be called in the Home Controller.

2) Controllers:
All controllers in MVC 4 are stored under a folder called controllers, if you want to create a new controller, right click on this folder and select add new controller and the new controller will be created with all functions if you picked the model "Table" you want to target for this controller.
All controllers MUST have Controller suffix.
Usually you have one controller per 1 entity, but you can design your controllers as you want.
Any action in any view should be mapped to a method in a controller, and the controller takes care of the execution and return the results to the view. That's why you see all controllers can return a view that could be a page or partial page, file, redirect, or Empty.
Check out this link for the types of result you could get from any controller method call:
http://msdn.microsoft.com/en-us/library/system.web.mvc.actionresult(v=vs.108).aspx


3) No Master page in the MVC4 web project:

You will not see a default master page in your project, the general look and feel in the project is controlled by a "Shared View", This Shared View acts as Master Page in the web forms.

If you want to modify the shared view, it is under Shared View Folder --> _layout.cshtml

You still can add a master page to your project  and link all your views to it.

4) Connecting to a database/ Creating your Model:
Model is your database/datasource file in the project. First thing you should do before creating any controllers or views is to create your entity model for your project.
There is no change in this regard. Just add any data entity file that you are familiar with such as: Entity Framework, Entity Data Model, LINQ or SQL Compact Db files.

After creating your model, you can add your controllers since the MVC 4 gives your the ability to create all your CRUD operations once you pick your entity/model and context "dbml or any data source file"


I want to keep it short and simple, I will keep posting more parts in details for building your first MVC 4 application.

Thanks and drop a line if you have any questions or feedback!


Regards,
Mostafa