Category Archives: .NET

Subscribe to published content types in SharePoint

Since SharePoint 2010 sharing content types between different site collection went much more easier than it was. Content Type Syndication introduced in SharePoint 2010 allowed publishing content type to subscriber site collection and use it. In SharePoint 2013 this feature remained and you can still use it for your solutions. In this article I will not focus on how you can establish content type publication, because it is well written here or here, but I will focus on how you can achieve same thing using PowerShell not GUI.  Continue reading

Identify inactive site collections in SharePoint

When identifying which site collections are inactive you have to first define the meaning of “inactive” term. There are at least two meanings of this word:

  1. No one accessed site collection since X days
  2. No one added/changed/deleted any content in site collection, but site collection might be still used by visitors

Continue reading

Manage SharePoint site collection disposition

Even with good governance, SharePoint sites can grow out of control. Sites are created as they are needed, but sites are rarely deleted. If sites persist when they are no longer needed, they require storage space and they might be unwanted for compliance reasons.

You can use site policies to help control site proliferation. A site policy defines the life-cycle of a site by specifying when the site will be closed and when it will be deleted.

In this article I will discuss some of actions that can be taken to prevent increase out of control site collections. Continue reading

Create a delayed site collection in SharePoint

Every site collection in SharePoint must have a template. Site collection structure and functionality is based on it. SharePoint provides many site templates from which you can choose the one that will fit your needs. You can also create and use your own as needed. Site collection template is mandatory, but is it possible to create site collection without specifying a template? Yes, it is! In this entry I will explain how to do that from UI and PowerShell perspective and what is a delayed site collection.
Continue reading

Use IncludeTimeValue attribute for DateTime fields in CAML using Camlex.NET

By default when you construct query using Camlex.NET attribute IncludeTimeValue is not used. As MSDN documentation states:

Optional Boolean. Specifies to build DateTime queries based on time as well as date. If you do not set this attribute, the time portion of queries that involve date and time are ignored.

In most cases there is no need to include time part in queries when you are looking for list items and your queries will work just fine. In my project it was essential to use date and time at the same time because millions of dollars depend upon several seconds.

Enough teory. It is time for practice. Continue reading

Turn off preview tab for Solution Explorer items in Visual Studio 2012

Visual Studio 2012 one of crucial tools for .NET Framework development was introduced in late 2012 and as always came with many great features.

One of them is a solution item preview. So when you click on a item in Solution Explorer it opens in preview tab. Some of you may think that it’s a great idea to see contents of a item (XML file, class, etc.) immediately after click. Well… probably it is, but I’m sure there is a group of people (including me) which find it very annoying. Continue reading

Build your own SharePoint 2013 development environment

As a SharePoint developer I’ve experienced many kinds of development environments. From installing SharePoint on host OS, going through remote desktop developing and ending on virtual machine. Some of them had advantages over others, but none of them was perfect. Everything worked as it could until Windows 7 came up.

Since Windows 7 each Microsoft’s operating system has the native support for VHD (Virtual Hard Disk). The same VHD files that are used in virtualization platform i.e.. Hyper-V, Virtual Server and Virtual PC.

Booting from VHDs means booting the machine as if running from primary hard disk so your operating system will use all the hardware available in your system like Graphics, Wireless, USB etc. which is not possible in most of the virtual environment. Continue reading