Saturday, January 19, 2013

Windows Phone Apps, SharePoint 2013 Online and Getting Free Development Started Using Visual Studio Express

Over at Christian Heindel's blog I read the post about authenticating with SharePoint 2013 from a Windows Phone app and thought I'd give it a try.

If you are impatient and just want to start developing here is what you have to do to get your development system on Windows 8 up and running:

Setting up the Development Environment

First I needed to set up my development environment. My operating system is a Windows 8 Pro and has until today been SharePoint-free. I used only Express editions of Visual Studio which you can get for free here.


Since I had already developed Windows Phone apps I had Visual Studio Express 2012 for Windows Phone installed and ready.

Next I needed to install the Microsoft SharePoint SDK for Windows Phone to get the necessary SharePoint assemblies. Seems like version 7.1 of the SDK is the only one available. Quote from the download page:
The Preview SDK installs Windows Phone CSOM libraries for Windows Phone, SharePoint Auth library for Windows Phone and Windows Phone Project Templates, which can be used to build Windows Phone 7.1 Applications against SharePoint 2013 Preview or SharePoint 2010.
The SDK setup did not recognize my Visual Studio Express 2012 and demanded a Visual Studio 2010 to be present. I searched some time for a newer SDK but did not find any.

So I sighed and installed Visual C# Express 2010. Next I installed SP1 via Windows Update so I could install Windows Phone SDK 7.1.


On Windows 8 I got a compatibility warning for the Windows Phone SDK and an error at the end of the setup which is related to XNA Game Studio. Just ignore it.

After the phone SDK I could finally install Microsoft SharePoint SDK Preview for Windows Phone 7.1. (Update: Install the final version instead, see below for details.)

The SharePoint SDK setup put the following assemblies to C:\Program Files (x86)\Microsoft SDKs\SharePoint\v15.0\Phone\v7.1\Libraries:
  • Microsoft.ProjectServer.Client.Phone.dll
  • Microsoft.SharePoint.Client.Phone.dll
  • Microsoft.SharePoint.Client.Phone.Runtime.dll
  • Microsoft.Sharepoint.Client.Taxonomy.Phone.dll
  • Microsoft.Sharepoint.Client.Userprofiles.Phone.dll
  • Microsoft.SharePoint.Phone.Application.dll

Quick Win Using One of the Sample Apps

You can download sample solutions from the Dev Center Page Christian linked to.

I chose the sample solution SharePoint 2013: Store and retrieve SharePoint list items on a Windows Phone since it sounded like it would be easy to test.

If you don't have a SharePoint 2013 Online site to test you can sign up for free for an Office 365 Developer Site.

After downloading the solution I opened it with Visual Studio Express 2012 for Windows Phone and built it - which succeeded without any problems. This was surprising since I expected that I have to add Microsoft.SharePoint.Client.Phone.Auth.UI.dll like Christian needed to do.

I didn't have to change the sample at all, it worked right out of the box. Which is good since Microsoft.SharePoint.Client.Phone.Auth.UI.dll is not present anywhere on my machine. The SharePoint-related references of the sample app look like this:


Apparently Authenticator in my case is coming from Microsoft.SharePoint.Client.Phone.Runtime.dll.

Now it was time to test, so I created a list, added a test item, modified TargetSiteUrl and TargetList in the sample app accordingly and that's it:

Hello SharePoint in the Cloud!

Update: SharePoint Preview SDK for Windows Phone 7.1 vs. Final Version

Seems like MSDN and the Sample Solutions need to be updated - they link to and reference the SharePoint Preview SDK while there is already the final version available!

The SharePoint SDK for Windows Phone 7.1 is available for download.

When building the sample projects you will now get errors for type Authenticator:
Error 1 The type or namespace name 'Authenticator' could not be found (are you missing a using directive or an assembly reference?)
The solution indeed is to add a reference to Microsoft.SharePoint.Client.Phone.Auth.UI. There are two other assemblies which are new in the final SDK, so if you are missing these make sure you don't have the preview installed:
  • Microsoft.SharePoint.Client.Search.Applications.Phone.dll
  • Microsoft.SharePoint.Client.Search.Phone.dll
Thanks Christian in the comments.

Friday, December 28, 2012

Solved: "Prefix '..' does not map to a namespace" when binding to a custom dependency property

I quickly want to share some information about a strange error I got when binding to one of my dependency properties and how to solve it.

The error is a TypeNameParserException with the following additional information: Prefix 'dp' does not map to a namespace.

TypeNameParserException

I got this when binding to one of my dependency properties with namespace, like this:

<ContextMenu x:Key="contextMenu" Tag="{Binding PlacementTarget.(dp:MyClass.MyDependencyProperty), RelativeSource={RelativeSource Self}, Mode=OneWay}">

As you can see the element is a context menu (which is defined in a Resources section, don't know if this matters). And I am binding to the dependency property dp:MyClass.MyDependencyProperty of the context menu's PlacementTarget (PlacementTarget is the element the context menu is invoked for).

This binding caused the problem because as soon as I opened the context menu I got the TypeNameParserException. When I removed this binding the error went away.

So this lead to the error:
Binding PlacementTarget.(dp:MyClass.MyDependencyProperty)

(Note: there were no compiler warnings, no squiggly lines, everything seemed valid.)
After some fiddling and googling I found the solution.

This solved the error:
Binding Path=PlacementTarget.(dp:MyClass.MyDependencyProperty)

It's simple: you explicitly have to specify the Path part! See the difference? Let's highlight it a bit more:

Binding Path=PlacementTarget.(dp:MyClass.MyDependencyProperty)

Maybe this helps you when you get strange namespace-related errors.

Sunday, December 16, 2012

A Better ULS Log File Viewer

While analyzing SharePoint ULS logs I felt the need for a better ULS log viewer. With more capabilities than the existing ones 1, 2. I don't like them. They are either old, look ugly or don't provide the capabilities I need.

Time to create a better one. Time for Heu's ULS Viewer.

I will provide more information soon.
Update - Download Heu's ULS Viewer here.
Until then here are some teaser screenshots:

Main View
Main view of Heu's ULS Viewer

Features:
  1.  Support for multiple log files
    • file contents will be concatenated
    • Drag & Drop support
    • fast log file parsing
  2. Extended filtering capabilities
    • decide in which of the columns you want to filter
    • two different filter types; you can choose to include items matching your search term, or to exlude items matching it
  3. Grid view of all log entries
    • sort by clicking column header
    • fast sorting even for large data sets
    • select multiple rows and copy them to clipboard by pressing Ctrl+C (good for quickly pasting them to a mail or support ticket)
  4. Detailed display of selected log entry
    • multi-line log entries are merged to one
    • proper formatting of stack traces
Visualization

Visualization of message count over time

Visualizing SharePoint ULS log messages provides a general survey you don't easily get when looking at the raw log data. For now there are two series: one for the overall log message count (in blue) and one for the log messages with level "Unexpected" (in red).

The diagrams respect your current filters.

That's all for today. I hope you are as excited as I am. Stay tuned for more!

Saturday, December 15, 2012

Getting Shell Integration for TFS when using TFS Cloud Services and Visual Studio Express 2012

I recently started using Team Foundation Service 2012 in the cloud together with Visual Studio Express 2012 for Windows Desktop. The cloud service allows me to easily put my sources under version control and schedule automatic builds without having to set up any servers.

From TortoiseSVN I am used to access source control features from the context menu of files and folders. For instance I want to be able to add files to source control directly from the right-click menu.

This is possible. The short-named Microsoft Visual Studio Team Foundation Server 2012 Update 1 Power Tools contains a shell extension which does exactly that. Cool!

But my first attempt to install the Power Tools failed. It thought having Visual Studio Express installed would be enough. But apparently you first have to install Team Explorer for Microsoft Visual Studio 2012.

Having done this the Power Tools installation succeeds and you get the full context menu goodness:

TFS shell integration



Monday, November 5, 2012

Remember: How to delete a Crawled Property

Deleting a crawled property from SharePoint is easy but sometimes requires a little preparation.
Summary | This post shows how to delete a crawled property and how to prepare it.
Deleting a crawled property might be necessary if
  • you are developing a custom indexing connector and are still testing it; obsolete properties will accumulate over time
  • your BDC changes from time to time and every change leads to new crawled properties being created with the next full crawl
  • $otherReason 
The list of all crawled properties can be found at Central Administration -> Search Service Application -> Queries and Results -> Metadata Properties -> Crawled Properties.

Deleting unused crawled properties

In SharePoint 2010 deleting a single crawled property is not possible. But you can delete all unused crawled properties of a category.

Go to Metadata Properties and click Categories:

In the context menu of a category click Edit Category:
Check the option Delete all unmapped crawled properties and click OK:
All unused crawled properties should be gone after clicking OK. But if the one you want to delete is still present then the next chapter is for you to read.

Unmapping and unindexing 

You have to remove all mappings from the property and you also have to remove it from the search index.

Click Edit/Map Property in the context menu of a crawled property:
Edit crawled property
The Edit Crawled Property page opens.
Edit Crawled Property
Make sure you
  • remove all mappings for this property
  • do not include values for this property in the search index
Repeat this for all properties which should be deleted when deleting unused properties of its category.

Note: Some OOB SharePoint crawled properties cannot be deleted.

Wednesday, October 31, 2012

Translation of SharePoint Terms from English to German


When writing technical documentation for SharePoint I frequently need to switch between the English and German terms for SharePoint interior. The German translation tends to produce constructs which often are funny and very long - and hard to remember. So I decided to assemble some vocabulary for quick reference.
Summary | This blog post provides you with SharePoint terms in English and their German translation. The post will be extended over time.

General

EnglishDeutschVersion
SiteWebsite2007
Site CollectionWebsitesammlung 2007
FarmFarm2007
Web ApplicationWebanwendung 2007
PageSeite 2007
Site ActionsWebsiteaktionen 2007
Site SettingsWebsiteeinstellungen2007
People and GroupsBenutzer und Gruppen 2007
Site collection administratorsWebsitesammlungsadministratoren 2007
Advanced permissionsErweiterte Berechtigungen 2007
Look and FeelAussehen und Verhalten 2007
Save site as templateWebsite als Vorlage speichern 2007
Site featuresWebsitefeatures 2007
TemplateVorlage 2007

Permissions

EnglishDeutschVersion
Permission LevelsBerechtigungsstufen2007
Limited AccessBeschränkter Zugriff2007
ReadLesen2007
ContributeTeilnehmen2007
DesignEntwerfen2007
Full ControlVollzugriff2007
List PermissionsListenberechtigungen2007
Manage ListsListen verwalten2007
Override Check OutAuschecken außer Kraft setzen2007
Add ItemsElemente hinzufügen2007
Edit ItemsElemente bearbeiten2007
Delete ItemsElemente löschen2007
View ItemsElemente anzeigen2007
Approve ItemsElemente genehmigen2007
Open ItemsElemente öffnen2007
View VersionsVersionen anzeigen2007
Delete VersionsVersionen löschen2007
Create AlertsBenachrichtigungen erstellen2007
View Application PagesAnwendungsseiten anzeigen2007

Search

EnglishDeutschVersion
Enterprise Search CenterUnternehmenssuchcenter2010
Basic Search CenterBasissuchcenter2010
Search Results Action LinksLinks für Suchaktionen2010
Search Action LinksHyperlinks für Suchergebnisaktionen2010
Search Core ResultsKernergebnisse der Suche2010
Refinement PanelVerfeinerungsbereich2010
Refinement Panel CaptionÜberschrift des Einschränkungsbereichs2010
Result Query OptionsAbfrageoptionen für Ergebnisse2010
RefinementEinschränkung2010
Accuracy IndexGenauigkeitsindex2010
Number of Categories to DisplayAnzahl der anzuzeigenden Kategorien2010
Number of Characters to DisplayAnzahl der anzuzeigenden Zeichen2010

Search Alerts

EnglishDeutschVersion
New AlertNeue Benachrichtigung2010
Alert TitleBenachrichtigungstitel2010

Central Administration

EnglishDeutschVersion
Application ManagementAnwendungsverwaltung2010
Manage web applicationsWebanwendungen verwalten2010
Manage service applicationsDienstanwendungen verwalten2010
Manage content databasesInhaltsdatenbanken verwalten2010

Search Service Application

EnglishDeutschVersion
Queries and ResultsAbfragen und Ergebnisse2010
Authoritative PagesAutorisierende Seiten2010
Federated LocationsPartnerspeicherorte2010
Metadata PropertiesMetadateneigenschaften2010
ScopesBereiche2010
Search Result RemovalSuchergebnisse entfernen2010
Search FederationPartnersuche2010
New locationNeuer Speicherort2010
Federated LocationPartnerspeicherort2010