Çarşamba, Eylül 29, 2010

Adding and Deploying Solutions with PowerShell in SharePoint 2010

Visual Studio 2010 makes it really easy to add and deploy solutions when you are developing (the F5 experience), but you may eventually want to deploy those solution packages elsewhere then on your development machine. We can still use the stsadm tool, but that is effectively considered deprecated now in favor of PowerShell.

To get started with PowerShell, run the SharePoint 2010 Management Console located in your Microsoft SharePoint 2010 Products folder on your start menu. This automatically loads the Microsoft.SharePoint.PowerShell snappin so that we can execute SharePoint commands.

image.axd (1)

Add-SPSolution c:\codefolder\SharePointSolution.wsp
Install-SPSolution –Identity SharePointSolution.wsp –WebApplication http://yoursharepointurl -GACDeployment
Update-SPSolution –Identity SharePointSolution.wsp –LiteralPath  c:\codefolder\SharePointSolution.wsp –GACDeployment
Uninstall-SPSolution –Identity SharePointSolution.wsp –WebApplication http://yoursharepointurl
Remove-SPSolution –Identity SharePointSolution.wsp

Also cool is getting your SharePoint version by using Powershell

function global:Get-SPFarm
return [Microsoft.SharePoint.Administration.SPFarm]::Local
$farm = Get-SPFarm


The result looks like

Major  Minor  Build  Revision
-----  -----  -----  --------
14     0      4536   1000</DIV>

Salı, Eylül 28, 2010

WCF service in SharePoint 2010

Just created custom WCF service in SharePoint 2010.

Incredibly straightforward which is just brilliant.

1. Followed this article on msdn

2. I also needed to add the following attributes to the service class

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]

From here on it works and can be referenced (“Add Service reference” in Visual Studio) from a client application.

Just remember to add mex to the end of the url to find the end point

for example


Without the “mex” you will get a HTTP: 400 internal error.

SharePoint 2010 - Access 2007 with Office 14

I hit a bug last night which was due to mixing some ADO and DAO code within a VB form inside an Access 2007 database. This had been working well until I moved it on to a laptop that had SharePoint Designer 2010 and SharePoint 2010 in Development mode installed. The operating system is Windows 7 ultimate 64 Bit but SharePoint designer and all of My office 2007 components are 32 bit.

The error is simply that Access crashed (no error message just your database is being restarted) on a line in code where I was creating a new ado recordset.

Comparing the references to a to a working version of the database on a similar machine which has no Office 14 components I noticed that the DAO or ACE reference was set to Microsoft Office 14 Access Database Engine Object Library on the working machine it was set to Microsoft Office 12 Access Database Engine Object Library. No problem I thought I would reset the reference to the 12 version. I navigated to the ‘C:\Program Files (x86)\Common Files\microsoft shared\OFFICE12\acedao.dll’ and it seemed to accept it but when I look at the references it has referenced 14 again. 

Mixing dao (ace) and ado isn’t wise so I removed the ado code and the database is now working on the laptop with SharePoint Designer installed.To be sure I have removed all ado code I simply removed the reference to the Microsoft ActiveX data objects library ran a debug compile and fixed the errors by replacing ado with dao code.

SharePoint 2010 - Default Date in DateTime Column

If you need a simple default date of the current date plus a number of days in a SharePoint List DateTime column add this formula to the default value field


Where 2 can be replaced by the number of days you wish to use as the offset

SharePoint 2010 - Multi Language User Interface

Among the many new user interface features found in SharePoint 2010 there is now greater support for localised sites. In previous versions the main method for getting translated versions of a site was via site variations. Now SharePoint sites can have their user interface presented in various languages. Now I hear you say SharePoint 2007 could do that, just set the language in the site settings and I would have to agree however the difference is that 2010 now support Multiple languages at the same time. A user can select their preferred language to be used when visiting the site simultaneously with another user using a different language!

In order to enable this you need to be running SharePoint server and install the language packs relevant to your users. The Language pack down load site is here http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=046f16a9-4bce-4149-8679-223755560d54

In the dropdown list select the language you wish to download then press change before pressing the download button. The German selection is shown below.

And French here

Note that the executable name is the same regardless of the language so store them in separate folders

Install the Language Packs

On your SharePoint server run this executable – follow the dialogs – it’s very straight forward.

On the final page you will see checkbox selected offering you the chance to run the products and technologies configuration wizard. You can run this after each language pack install or once after all have been installed which saves a bit of time.

Repeat this for each language pack.

Run the products and technologies Configuration wizard.

Selecting the Languages

Now logon to the server as a site collection owner

Site Actions Site Settings Language Settings to see the screen below

Tick the boxes for each language you wish to support in the site

When a user connects to your sit they will have the option to select their preferred language

Press the user-id link in the top right hand corner to see the following

The site will then be changed to that language and remembered when the user returns to the site

Supported Elements

The following are displayed in the selected language

Navigation Menus
Standard text, headings and other UI elements
List/ Library Standard Column Headings

Source: http://www.davessharepoint.com/2010/07/sharepoint-2010-multi-language-user.html

SharePoint - Sometimes you can't change the Colum ordering of a list or library

Sometimes the link (in the list or library settings) about the Colum ordering is not visible. If you want to change the column ordering of the SharePoint 2007 Form in that situation you can edit the url e.g. from:




As you can see you only have to change to part before .apsx from listedit to formEdt.


Pazar, Eylül 19, 2010

SharePoint 2010 - Site Templates

Site templates are a great feature within SharePoint that allow us to build a Web Site, customise it then save it as a template or starting point for other Sites. For example a basic company site can be developed. Create a new site from this template and customise it to add say Sales Department specific content. The marketing department like the sales department site but want some changes – they simply create their site from the sales site template then make their own changes.

Another possible scenario on the Web – a SharePoint server dedicated to user groups or social clubs for example – one group builds their site containing common content (member list, Event dates, speaker lists) then other groups use templates to create their own and build from the common starting point rather than starting from scratch. No need for any developers at all :-(

Site templates as in ‘.STP’ files have gone from SP 2010. When a site is saved as a template a solution file (‘.wsp file’) is created and added to the new user solutions gallery. This is the gallery where sandboxed solutions are stored.

Before the template shows up as an item in the create site dialog it needs to be activated. Simply click on the template item in the User Solutions Gallery and from the menu select activate. This brings up a SilverLight dialog (if you have SilverLight enabled) where you are presented with a warning and an activate button. When I pressed this the activation went ahead and a new view of the user solutions gallery appeared within my SilverLight dialog – not sure if this is supposed to happen but it seems wrong - hopefully this will be sorted by RTM. Anyway I can now create a new site based on my template. Over time I will be testing this to see when I can use it and when not. For now I have been trying a few simple scenarios.

Scenarios tried so far

Simple blank site – saved and restored fine

Added simple workflow via Designer – new site is fine and workflow runs successfully

Amended workflow to add a task to the site owner (administrator) – saved a new template - created the new site from the template – all well.

Simple site with unique permissions - Added a user - Added tasks list and in workflow assigned task to the new user – site creation failed !

In the last scenario there were no ‘uls’ log entries to help and the error was a simple ‘An unexpected error has occurred’ – I suspect that because the user doesn’t exist in the site – I had hoped the template would include the users but maybe it’s better to keep security separate from the template mechanism – either way the error message doesn’t help much but this is beta code

The great thing is that the template is a solution file which can now be imported into Visual Studio 2010. If you are willing to learn the contents of the solution then it can be amended within Visual Studio ready for deployment to other servers. Although not an everyday requirement it shows that the development tools are being taken seriously and being integrated into the SharePoint infrastructure.

Perşembe, Eylül 16, 2010

SharePoint 2010 - Very useful How To’s

I found these yesterday and am already getting great benefit from them. At the moment I am getting up to speed with the javascript client Object Model for SharePoint so thisvideo was particularly interesting. the code download is great as well.

Pazar, Eylül 05, 2010

SharePoint 2010 - Calendars

As part of a talk I am creating and part of my general SP 2010 study I have been looking into the SharePoint 2010 calendar list. The new overlay feature is really nice. It allows you to show many calendars at once (overlayed) so for example a project manager could look at calendars from different project sites and plan common resources without having to look at each calendar individually. This has been available via third party web parts for a long time but now it's available out of the box. Since it has been blogged about in abundance elsewhere I won't reproduce the details here.
One thing I had hoped for was the listview web part representing the calendar would be able to 'connect' using the web part connection technology to allow filtering between web parts. I.E. From the part representing my calendar I would like to be able to select a date and have this passed through the connection to other web parts.
In the browser the connections menu is greyed out within the Web Part menu. In SharePoint designer you get further but then it gives an SPException when you fill in the source and destination of the connection.
Maybe the RTM version will fix this and allow connections (hopefully) or at least remove the exception.
Regardless of this we can see how improvements that each version of SharePoint brings such as the calendar overlay can be used to create some really useful and interesting business solutions.

Çarşamba, Eylül 01, 2010

SharePoint 2010 - Error occurred in deployment step ‘Recycle IIS Application Pool’

SharePoint 2010 icin Visual Studio 2010 uzerinde uygulama gelistirip deploy ettiginizde bazi guvenlik ve erisim hatalari alabiliyorsunuz. Bunlardan en belirgini ise asagidaki olandir.


Error occurred in deployment step ‘Recycle IIS Application Pool’: <nativehr>0×80070005</nativehr><nativestack></nativestack>Access denied


Cozumu ise oldukca basittir. Gelistirme yapmis oldugunuz kullaniciyi site collection administrator grubuna eklemis olmaniz gerekir. Sonrasinda sisteminizi logoff/logon (eger imkaniniz yoksa ayarlar 15 dakika sonra kendisini aktiflestirir) yaparak kullanabilirsiniz.


Ayrica gelistirme yaparken Visual Studio ‘yu Administrator olarak acmayi unutmayin!!!


Iyi gunler…