månadsarkiv: december 2013

Custom Error and Access denied pages in Sharepoint

Anatoly Mironov:

Unfortunately in SharePoint 2013 the custom error pages are not applied: link 1, link 2. Hopefully there will be a hotfix that solves it.

Originally posted on morethansharepoint:

Ok, lets get started.

So for my latest project I had to replace the default sharepoint error pages with a custom one. There are different types of error pages such as the ones for 404 and 500 errors. These are set by IIS and are basically simple html pages that are shown if the requested page is not found or other errors.  But the error page that sharepoint uses is shown for errors that relate to sharepoint and shows correlation id and a simple message.

The default page for this type of error is located in the 14 hive /template/layouts/error.aspx.

Error.aspx inherits from Microsoft.Sharepoint.ApplicationPages.ErrorPage and by examining this in Reflector it’s relatively easy to see how it works. When an error occurs, the Item collection in the HttpContext gets filled by some keys such as ErrorText and ErrorCorrelationId. The error page simply gets these strings from the context (and also…

View original 150 more words

PowerShell: Get version and ProductId from an .app package

In my project I deploy some apps directly through the ObjectModel directly with PowerShell. The apps are built with TFS

I have a script that installs or updates apps if there is a new version of the app. Previously I used Import-SPAppPackage to compare the version and productid with an existing app instance, but often I get this error:

The provided App differs from another App with the same version and product ID.

Here you have the issue. Now the solution is to read the AppManifest.xml. But first the .app package has to be extracted like a usual zip file. This is the powershell function for that: