Dienstag, 19. Februar 2013

Debugging SharePoint

 

To know which w3wp Process you need to attach just use this command:

C:\wondows\System32\inetsrv\appcmd list wp

Found here: Attaching specific W3WP Worker Process in SharePoint Custom Code Debugging.

Mittwoch, 13. Februar 2013

Change from Managed to Structural Navigation in SharePoint 2013 publishing programmatically


I developped a WebTemplate based on a Publishing site definition. The publishing features activated Managed Navigation by default. And I was unable to find how to change it programmatically. Then I used SharePoint Manager 2013 and found in the web Properties following key: SPFeatureProperty
And this was the Value:
<?xml version="1.0" encoding="utf-16" standalone="yes"?>
<WebNavigationSettings Version="1.1">
  <SiteMapProviderSettings>
    <SwitchableSiteMapProviderSettings Name="CurrentNavigationSwitchableProvider" UseParentSiteMap="True" />
    <TaxonomySiteMapProviderSettings Name="CurrentNavigationTaxonomyProvider" UseParentSiteMap="True" />
    <SwitchableSiteMapProviderSettings Name="GlobalNavigationSwitchableProvider" UseParentSiteMap="True" />
    <TaxonomySiteMapProviderSettings Name="GlobalNavigationTaxonomyProvider" UseParentSiteMap="True" />
  </SiteMapProviderSettings>
<NewPageSettings AddNewPagesToNavigation="True" CreateFriendlyUrlsForNewPages="True"/>
</WebNavigationSettings>

I Compared it tot he value of a second web I configured through the SiteSetting interface:
<?xml version="1.0" encoding="utf-16" standalone="yes"?>
<WebNavigationSettings Version="1.1">
  <SiteMapProviderSettings>
    <SwitchableSiteMapProviderSettings Name="CurrentNavigationSwitchableProvider" TargetProviderName="CurrentNavigation" />
    <TaxonomySiteMapProviderSettings Name="CurrentNavigationTaxonomyProvider" Disabled="True" />
    <SwitchableSiteMapProviderSettings Name="GlobalNavigationSwitchableProvider" UseParentSiteMap="True" />
    <TaxonomySiteMapProviderSettings Name="GlobalNavigationTaxonomyProvider" UseParentSiteMap="True" />
  </SiteMapProviderSettings>
  <NewPageSettings AddNewPagesToNavigation="True" CreateFriendlyUrlsForNewPages="True"/>
</WebNavigationSettings>

So I started looking for the WebNavigationSettings Class and I found this Post: Working with publishing navigation in SharePoint 2013
Here ist the code like it should be in a feature receiver:
SPWeb web = (SPWeb)properties.Feature.Parent;
myNavigationSettings.CurrentNavigation.Source = StandardNavigationSource.PortalProvider;
myNavigationSettings.Update();

StandardNavigationSource is an enumeration and looks like this:
public enum StandardNavigationSource
    {
        Unknown = 0,
        PortalProvider = 1,
        TaxonomyProvider = 2,
        InheritFromParentWeb = 3,
    }

Montag, 4. Februar 2013

Site Provisioning Best Practice

 

Site Provisioning is always important in SharePoint Projects. In this article I’ll put every interesting information on this subject.

Even if its about SharePoint 2010, following Post is really interesting and in my eyes a must read: SharePoint 2010 and web templates.

So what are the different Provisioning Possibilities:

1 Full-blown Site Definition:

In my opinion site Definitions are not really an option because it’s not supported to change the onet.xml once a single Site is provisioned using this site definition. A possible Workaround is the “minimal Site Definition approach”.

2 minimal Site Definition

I’ll update this part once I explore this possibility.

3 WebTemplates

I tried Vesa Juvonen’s solution in the above linked Post. It worked fine even with SharePoint 2013. I just needed make some small changes.

So What Changed in SharePoint 2013?

In 2013 It seems to me that deploying a Web with a WebTemplate will fail if some features from the <SiteFeatures> section of the web Onet.xml are not activated.

So this part was not working:

image

I simply included this part in the WebFeature part:

image

Montag, 28. Januar 2013

Deploy to Hostheader Error

 

image

I added the host header to the Hosts file as described in some blogs. Unfortunately SharePoint started asking me for my credentials.

The solution was to delete the entry from the hosts file and extend the web application site with the server name.

Donnerstag, 17. Januar 2013

The trial period for this product has expired.

 

Recently after some windows updates i got this error on my SharePoint sites.

image

In the SharePoint Log-files I found this error:

Failure checking user access permissions for User Profile Application Proxy 'User Profile Service Application'. Exception: Microsoft.SharePoint.SPException: The trial period for this product has expired.

I found this Blogentry

So I tried first the solution at the end of the article, becose the first one semed to be awkward. I did this

psconfig -cmd secureresources

Still the same error, even after an iisreset and a server restart.

I found there in the comments a link to a technet entry and then found the solution:

Workaround: In central admin go to "Central Admin" => Monitoring => "Review Rule Definitions" => click on "Trial period for this product is about to expire" rule under configuration and edit it. Uncheck the "Enabled" checkbox.

image

image

So I did this.

Still the same error even after iisreset.

So I got back and tried the first Ugly solution.

Still the same error even after iisreset.

In the IIS I found this:

image

So I started the The web Services Application

Still the same error even after iisreset.

And I’m still searching for a solution.

Finally I looked in SharePoint central Administration – Upgrade and Migration - Convert farm license type. And there I found the problem:

image

After an iisreset everything went well.

Sometimes error messages are really what they seems to be. Even Microsoft error Messages.

Samstag, 8. Dezember 2012

"The Workbook cannot be oppened." in SharePoint 2013


Last Week I installed SharePoint 2013 for a customer. After installation I got the same error with the Excel Web Part as described in this Post.

I tried the proposed Solution:

$webApplication = Get-SPWebApplication "http://intranet "
$webApplication.GrantAccessToProcessIdentity("Domain\serviceAccount")

In the PowerShell-Window the Script the powershell command seemed to be executed succesfully but nothing changed. A look in the SQL Management Studio confirmed that no permissions has been granted for the Service Account. 

After a second look at the Content Database permissions I understood the problem. My Admin Account was not db_owner on the Content_Database because I was added afterward. I asked the main Administrator to execute the above Commands, and everything worked well. 

So if you add a new Administrator to the Farm-Admins, don't forget that this account will not have all permissions Granted as you think.


Dienstag, 19. Juni 2012

SharePoint 2010 Cumulative Updates installation order


Are you about to update your outdated SharePoint 2010 installation and wondering if you need to apply all Cumulative updates in release order or just the latest one? The answer is: Just the latest one. That’s why it’s called Cumulative Updates, they include all previous fixes since the last Service Pack.


More information on the technet site