Patrick's SharePoint Blog

SharePoint's Booming world

Upgrading SP 2010 solutions to SP 2013 with resources in _layouts

Posted by Patrick Boom on July 24, 2013

As SharePoint 2013 is making it way to the developers, solutions get upgraded to SharePoint 2013.

One of the things people encountered is issues with javascripts and images when upgrading their solutions.
Thanks to Keith Tuomi, I will post the source of the problems here.

SharePoint 2013 offers the ability to be compatible with SharePoint 2010. In short, this means that a lot of features are ‘double’, one of which is the special reference in IIS to the _layouts folder.

In SharePoint 2013, the reference to the 15 hive is “_layouts/15” and NOT “_layouts”. Instead, “_layouts” points to the 14 hive.

In short, if you have resources and code relying on server side code and mappings, make sure you update the references to these files to point to the correct virtual directory!

Thanks to Keith for this information.


3 Responses to “Upgrading SP 2010 solutions to SP 2013 with resources in _layouts”

  1. Jeroen van Lieshout said

    In server side code you can use SPUtility.ContextLayoutsFolder to retrieve the layouts folder. If the site is running in 2010 mode it points you to the 14 hive. In 2013 mode it points you automatically to the 15 hive. The only thing to keep in mind is that you should deploy your wsp’s then with compatibilitylevel 14,15 to make sure your custom stuff works in 2010 and 2013 mode.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: