Category Archives: Software Development

The main theme of this blog: SharePoint, C#, ASP.NET, yada, yada

Managed Metadata Service: DefaultSiteCollectionTermStore == null

I happened to configure my SP2010 farm using Powershell automated scripts and and as a result my default Metadata term store proxy was not default for any new or existing site collections.  This issue manifested itself when I was trying to access the default site collection term store via the SharePoint API as a property of the TaxonomySession class.

I came across the following blog post, which got me as far as establishing the metadata service proxy as default for site collection.  To access the DefaultSiteCollectionTermStore property I had to configure additional permissions.

By default my Metadata Service Applications allowed permitted access to the farm and application pool accounts, but my custom code was running under the context of the logged in user.  To rectify this issue I could either elevate permissions to run as the app pool user, or give the logged in user explicit permissions by clicking through as follows in Central Administration:

1. Central Administration

2. Application Management

3. Manage Service Applications

4. Metadata Service Application (not the proxy)

5. Permissions (Ribbon)

6. Add the user via the dialog and give them permissions to access the application.

Interview Questions for SharePoint Developer Position

See how you do…

Q1. Name two SharePoint API objects you should define to open a site collection and sub web.

Q2. What is the role of the Shared Services provider in Microsoft Office SharePoint Server 2007?

Q3. How man content databases can a site collection span?

Q4. Can a content database contain multiple site collections?

Q5. What SharePoint capability allows navigation access to multiple site collections in a single site collection?

Q6. What is STSADM?

Q7. What is a metadata property in the search configuration?

Q8. What SharePoint capability allows for the use of multiple domain names for the same SharePoint site application?

Q9. What is a SharePoint Feature and how are they deployed?

Q10. Name all 4 feature scope levels

Q11. Name two development approaches to creating a WSP (SharePoint Deployment Package)

Q12. Should you dispose an instance of SPWeb obtained from the ALLWEBS collection of an SPSite object?

Q13. Should you dispose the ROOTWEB object of an SPSite object?

Q14. Should you dispose the site or web objects referenced from SPCONTEXT?

Q15. Your site crashes and SharePoint reports a standard error message after installing some custom code, how would you diagnose the issue?

Q16. How would you apply a common branding to all pages on your publishing sites?

Q17. What feature do page layouts belong?

Q18. How many direct parent content types may a child content type have?

Q19. Comment on why explicit permissions given to list items is bad practice

Q20. Is “Contributors” a SharePoint Group or Permission Level?

Q21. What is the role of the term store?

Q22. Comment how SP2010 no longer uses the SSP, and the new approach to service architecture

Q23. What is the sandbox?

Q24. What is Claims-Based-Authentication?

Q25. What Microsoft Office application allows design and implementation of workflows visually?

SP2010 Features – Reference

This post is to help my my strained memory, the following post contains a list of all SharePoint 2010 feature GUIDs

SP2010 ListData.svc give 404

If you see an HTTP 404 when accessing the /_vti_bin/ListData.svc WCF service in SharePoint 2010 then be sure to install the ADO.NET Data Services 1.5 CTP2

Link

Site Collection URL in a User Control

Ever have a problem remembering something small, I do.  No matter how many projects I develop in SharePoint I cannot seem to remember how to reference the site collection URL from a user control.  So, after digging around for 5 minutes to find the answer I decided to blog it and save my aging memory:

<%$SPUrl:~SiteCollection/ %>

SP2010 Sandbox Development Tip

If you want to make sure that you aren’t using any of the restricted APIs before you deploy your solution to a sandbox environment, manually reference your project against:

[SharePoint Root]\UserCode\assemblies\Microsoft.SharePoint.dll  

If your code compiles, then you’re pretty safe!

NEVER DEPLOY code with this Microsoft.SharePoint.dll reference, instead reference the Microsoft.SharePoint.dll in

[SharePoint Root]\ISAPI folder.

From the SharePoint 2010 book I’m reviewing

Debugging SP2010 Sandbox Code – Short and Sweet

If you find yourself in a situation when you need to attach to a process from VS 2010, to debug,  and you’re code is running in a “sandbox”.  You need to attach to the process SPUserCodeService.exe, not w3wp.exe.

SharePoint 2010 hosts sandbox code in a secure service – the user code service – so it can monitor resources and make sure the user’s code isn’t performing any action that could compromise the platform.

From the SharePoint 2010 book I’m reviewing

Development Setup for SP2010

Some important points to remember when developing against SP2010:

  • Make sure your Visual Studio project is set up for .NET 3.5, not .NET 4.0
  • Run Visual Studio as an Administrator to load debugging symbols
  • Make sure your project is set to compile for Any CPU or x64 (not x86 by default), otherwise your code will throw a FileNotFoundException

From the SharePoint 2010 book I’m reviewing

Balsamiq Mockups makes for easy UI design

We’ve been using Balsamiq Mockups for some time at my day job, but until recently I hadn’t used the tool heavily on any of the projects I’d been working.  Today I needed to shell out an example search results page for a project I am architecting in SharePoint.

Think of Balsamiq Mockups as Visio for the layman – it’s light, easy to use, not cluttered with unnecessary functionality, and runs on Adobe Air.  The presentation is something akin to what you might mockup on a whiteboard in the office and the end result, although a signature of the Balsamiq development team, is crisp and ideal for any document deliverable.

What I like about the tool most is that I was able to complete a mockup, which is functional for discussion purposes and doubles for architecture documentation, and it took me a fraction of the time I’d have spent in Visio – this gave me time to write this blog post.

At a price of $79, the product is a steal for the time it’ll save you.

Check out my finished page mockup:

Global Search Results

Ctrl-F Crash in Visual Studio

I have Resharper 4 installed into Visual Studio 2008.  On 64-bit the CTRL-F functionality crashes the application, which has driving me nuts.  My colleague Anand posted a solution to our company Intranet, so I stole his post for my blog for future reference. 

Thanks Anand ;)

“Visual Studio might crash when using the Find feature on a 64 bit system. This msdn article explains the issue. KB947841 I uncovered this problem after installing resharper on a 64-bit system, however, it is not related to resharper. Installing this add-in simply uncovers this bug in visual studio. You need to request this hotfix ”

Follow

Get every new post delivered to your Inbox.

Join 162 other followers

%d bloggers like this: