Posts

Deal easily with Safe Controls problems in SharePoint with Visual Studio 2010

Image
You get the following error when you try to add a custom WebPart in to your site: " Type is not registered as safe " Error Message This means that you: Don't have an web.config entry for your dll have a wrong web.config entry for your dll The 2nd reason is more often, especially when you develop a WebPart in Visual Studio and change the default Class or NameSpace names. Steps to solve the problem 1. Check your web.config This step is only to check if there is a web.config entry when you deploy your solution. For this deploy your solution into the farm. Open your web.config file in (C:\inetpub\wwwroot\wss\VirtualDirectories\youwebapp\web.config). Search after "<SafeControls>" and check if your dll is listed there and if so check if all parameters like PublicKeyToken, NameSpace or DLLName are correct Safe Control Entry in Web.Config Tip : If oyu deployed your assembly into the GAC, you can check the "PublicKeyT...

Different list views for folders, content types and files in SharePoint 2010

Image
There is a not well known feature of SharePoint I want to show. You can create different default list views for different content types. As an example you have a top folder for specific orders which is automatically created by your customer when he orders something. Within this folder you and your customer exchange documents. You goal is that when someone enters the order list he only sees his folder. 1. Attempt My first opinion would be to create a list view with a specific filter. But here begins the problem: How should the filter look like ? If you set " Created By = [Me] " the customer will only see documents and folders he created. When you use " Created By = [Me] & Contenttype = Folder " he would not see subfolders created by others. 2. Attempt The more elegant way is to use different content types for top folders and subfolders. Based on the content types you can create different default views. 2.1 Create Content Types So create a new con...

Debugging IIS 7.5 FTP Custom Authentication Provider

Image
A customers need was to have quickly an ftp server to share large files with some third party. The security restrictrions in our company need a two-factor autentication. So I had the idea to create a custom authentication provider where the user can provider his password and token in the ftp password field like password#token. In this post I will not explain how you create a custom authetication provider. This is explained very well on the links I'll post. I found this great blog post of Robert MyMurray where he describes how to create a custom provider with multiple examples. I followed his steps and realized that I couldn't debug the code I wrote with Visual Studio. Then I found this post on iis.net, which finally helped me to debug my code. Steps to debug: I assume that: You already created a solution and implemeted one of the examples of Rober McMurray or your own one. You signed your dll and deployed it to your Global Assembly Cache You installed and co...

Offline Metadata Instances in SharePoint 2010 & OfflineTermstoreNames

If you're using powershell to add metadata to your termstore and you see only an entry in the OfflineTermstoreNames property, then it seems that some of your Metadata Services are offline. C:\> $site = Get-SPSite http://mysharepoint/sites/project C:\> $session = new-object Microsoft.SharePoint.Taxonomy.TaxonomySession($site)  C:\> $session To activate all instances open the SharePoint Management Shell and type: C:\>$instance = Get-SPServiceInstance | ? {$_.TypeName -eq "Managed Metadata Service"} C:\>$instace It will now display all your instances. If the e.g. first and second are disabled, start it with: C:\>$instance[0] | Start-SPServiceInstance #Start First C:\>$instance[1] | Start-SPServiceInstance #Start Second Wait few minutes. Grab the instance again and check if they are enabled: C:\>$instance = Get-SPServiceInstance | ? {$_.TypeName -eq "Managed Metadata Service"} C:\>$instace Now all Termstores should be...

Migrate a SharePoint Team Wiki to an Enterprise Wiki

Perhaps someone has also migrated his old SharePoint 2007 Team Wiki to SharePoint 2010 and wants to have the cool features from an Enterprise Wiki. I searched a while and I think the best way to do this is to migrate with PowerShell. The List Wiki and the Enterprise Wiki are using different fields so there will be no other way I thing but PowerShell or manually. So the great script for your use. Just adapt the settings for your environment. <# PowerShell Script to migrate Team Wikis into Enterprise Wiki Pages #> # Setup Basic sites and pages $webappURL = "http://sharepoint-uat" $wikiSiteURL = "$webappURL/sites/serverplatforms" $wikiWebURL = "$wikiSiteURL/wiki" $pageFolder = "/Seiten/" $oldWikiWeb = "$webappURL/sites/serverplatforms" $wikiListName = "Team Wiki" try { Write-Host " >> STARTING MIGRATION ..." -foregroundcolo...

Using WebDav on IIS 7 to access UNC Paths

Image
In this post I want to show you step by step how to connect to a file share using webdav on IIS 7. For this post I assume: that you have already an IIS installed on the server  that you have installed WebDav or enabled the WebDav Feature on IIS. the server on which is IIS installed can reach the file share. 1: CREATE APPLICATION POOL The first step is to create a seperate application pool on the IIS. Open the program "Internet Information Services Manager". Click on "Application Pools" Click on "Add Application Pool" on the right menu Name it "WebDav". Let the rest as it. Right click on the new created Application Pool "WebDav" and select "Advanced Settings". Pay attention to the following attributes: .Net Framework Version : No Managed Code Identity : The identity of the Application Pool should be an account which has permissions to read the file share. Load User Profile : Should be set to "False...

How to debug the SharePoint People Picker Problems

Image
In complex environments you often have to adapt the SharePoint people picker settings for performance or other business needs reason. In this post I'll show two common problems. Example 1: The people picker takes too long to find a user. The szenario is that you search for a user and you wait 1 or longer minute before the user is displayed in the people picker. One reason for that is often that the whole AD with all subtrees and trusted ADs is searched. This can be easily fixed by setting a filter to the people picker (like shown here ). Another reason can be that there are multiple Domain Controllers which the SharePoint Server tries to contact. There will be a delay if some of them are sitting behind a firewall like in a DMZ. This can be fixed by opening the ports to the DCs or by modifiying the host file, by pointing th IP of the DCs behind the firewall to  DCs in front. Example 2: Your company consists of multiple branches with their own AD You can tell the people...