2012-04-26

AppFabric for Windows Server 1.1 - Powershell is not working after upgrade from 1.0

After the installation of AppFabric for Windows Server 1.1, the Powershell to manage the cache cluster was not working anymore.

The bug - Could not load file or assembly Microsoft.ApplicationServer.Caching.SqlProvider


Use-CacheCluster : ErrorCode:SubStatus:Provider "System.Data.SqlClient" instantiation failed: Could not load file or assembly 'Microsoft.ApplicationServer.Caching.SqlProvider, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find th e file specified. At line:1 char:62 + Import-Module DistributedCacheAdministration;Use-CacheCluster <<<< + CategoryInfo : NotSpecified: (:) [Use-CacheCluster], DataCacheException + FullyQualifiedErrorId : ERRCMS0007,Microsoft.ApplicationServer.Caching.Commands.UseCacheClusterCommand

The resolution

After a couple of hours searching on the internet, I found nothing to resolve the problem... so I tried to hacked myself. I found the solution! There is a missing DDL in the DistributedCacheAdministration Powershell module. I've simply added the missing DLL in the configuration file (C:\Program Files\AppFabric 1.1 for Windows Server\PowershellModules\DistributedCacheAdministration\DistributedCacheAdministration.psd1) of the module :
@{ ModuleVersion = '1.0' GUID = 'e0f1ac07-c706-4b65-ac0b-63ac0ab31237' Author = 'Microsoft Corporation' CompanyName = 'Microsoft Corporation' Copyright = '(c) Microsoft Corporation. All rights reserved.' Description = 'Microsoft AppFabric Caching Administration module' PowerShellVersion = '2.0' RequiredAssemblies="..\..\Microsoft.ApplicationServer.Caching.SqlProvider.dll", "..\..\Microsoft.ApplicationServer.Caching.Management.dll", "..\..\Microsoft.ApplicationServer.Caching.Server.dll", "..\..\Microsoft.ApplicationServer.Caching.Core.dll", "..\..\Microsoft.WindowsFabric.Common.dll", "..\..\Microsoft.WindowsFabric.Data.dll", "..\..\Microsoft.WindowsFabric.Data.Common.dll", "..\..\Microsoft.WindowsFabric.Federation.dll" TypesToProcess = @() FormatsToProcess = 'Microsoft.ApplicationServer.Caching.ManagementPS.format.ps1xml' NestedModules = 'Microsoft.ApplicationServer.Caching.ManagementPS' CmdletsToExport = '*' }

Good luck with your future evil AppFabric configuration problem!

2010-02-02

SharePoint Summit 2010 - Montréal

Hi,


My partner Sébastien Leduc is going to present a session on how to do agile development with SharePoint, April 13, 2010, in Montréal. I suggest everyone that assist SharePoint Summit 2010 to go see it. It’s going to be a nice and practical session.


Here the link for more detail : http://www.sharepointsummit2010.com/conference_day2.htm#session_9_5


See you there!

2010-01-24

How-to synchronize SharePoint Designer Workflows with sharegate

Hi,

This is my second article about sharegate because their new feature (Workflows Comparison and Synchronization) is really useful. Deploying SharePoint Designer workflows from a development environment to a production environment is currently impossible since you can't export re-attach the workflows to a list automatically.

The article will show how to use sharegate to replicate workflows between two SharePoint sites.

Step 1 - Start comparison with the Workflow Feature

  1. Open sharegate
  2. Select source and destination servers
  3. Select sites to compare
  4. Select the Workflows Feature
  5. Map you domain*
  6. Start the comparison

*Since two sites collections can be on different domain you have to map source domains with destination domains. If a workflow action or condition is set to the user, the domain name will be replaced. For example, BEX\guillaume.roy will be replaced by OTHERDOMAIN\guillaume.roy.

DomainMapping

 

Step 2 - Select the workflows to synchronize

You can see under the site node that the “Workflows” icon has been added. sharegate will synchronize all dependencies of your workflows :
  1. Content Types
  2. Lists (including WSS lists : Workflow History, Workflows, Tasks)
  3. Site Columns

Comparison

Step 3 - Compare workflow file content

You can click the “Details” button on each workflow files to see it’s content and differences.

ComparisonSeeFile 

sharegate automatically maps all dependencies of your workflow with the destination site (content types, lists, site columns, user domain) and will ignore all server sensitive information.

ComparisonSeeFileDetail

Step 4 - Sync it!

Finally, you have to click the synchronize button in the ribbon bar. After the synchronization, you can see the file differences using the detail button.

2010-01-15

ASP.NET MVC - Easy way to manage page title

Hi,

As a developer it’s always a pain to manage titles for each page of a web application :)

1 – Create an ActionFilterAttribute

/// <summary>
/// Specifies the title and keywords for the page
/// </summary>
public class HeaderAttribute : ActionFilterAttribute
{
private string _title;

public HeaderAttribute(string title)
{
_title = title;
}

public override void OnActionExecuting(ActionExecutingContext filterContext)
{
base.OnActionExecuting(filterContext);

if (filterContext != null && filterContext.Controller != null)
{
filterContext.Controller.ViewData["_Title"] = _title;
}
}
}

2 – Add the title in the Master Page


Here’s the code to add in the master page. Don’t forget to put it in all your Master Pages…


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title><%= ViewData["_Title"]%></title>
<meta name="title" content="<%= ViewData["_Title"] %>" />
</head>

3 – Put the attribute to your actions


You can now use the attribute over a controller (each action will have the title) or an action.


[Header("My Web Site - Default Page")]
public class HomeController : BaseController
{
[Header("My Web Site - Home")]
public ActionResult Index()
{
return View();
}

// The title will be "My Web Site - Default Page"
public ActionResult Buy()
{
return View();
}
}

That’s it! You can also add other specific action <meta> tags like keywords and description.


2010-01-08

How-to synchronize SharePoint permissions with sharegate

Hi,


Having hard time to move permissions between your SharePoint environments (DEV to QA, QA to PROD, PROD to QA, ...)? This article will show a quick and easy way to synchronize SharePoint 2007 permissions with a tool named sharegate (http://www.share-gate.com).


Step 1 : Enter Source and Destination Server


Step 2 : Choose sites to compare


Step 3 : Select the feature named Permissions



Step 4 : Select the difference to push on the destination server
In this screen you will see all permissions in your SharePoint site Structure. sharegate allow you to :
  1. Set permissions to a list
  2. Manage Groups and Membership of the site collection
  3. Manage Permission Levels of the site collection and sites
  4. Set permissions to the site collection

By default, all differences between the source and the destination is checked. If you need to synchronize a single list, you can uncheck all other differences.


Step 5 : Click the synchronize button
The last step is to click the Synchronize button. A screen will display all actions that will be executed on the destination server.



That's all! Your security is the same on both servers!