I am trying to brand a SP site. It is on a virtual machine on another box.

I setup my custom master file in SPD on a local (non-server) machine. The custom master file points to the custom CSS file like this:

<SharePoint:CssRegistration name="Style Library/SiteName/style.css" After="corev4.css" runat="server"/>

Now I go into All Files and point at the Style Library. I create a SiteName folder. In the folder I create style.css. I check out and then publish the .css file (do I need to do that?)

When I try to run the SP site from the server, I get the typical "file not found" message:

Cannot make a cache safe URL for "1033/styles/Style Library/SiteName/style.css", file not found. Please verify that the file exists under the layouts directory.

When I log on to the server and look in IIS Management, I can't find Style Library anywhere. What's going on?

2 Answers 2


Unlike traditional ASP.NET web sites, SharePoint stores much of its information in Database and retrieves them from database so there won't be able to map SharePoint Urls to IIS site structure. For more information. To understand how SharePoint modifies the ASP.NET Pipeline to achieve this, check Microsoft SharePoint Foundation as an ASP.NET Application

If you are using Publishing Sites (SharePoint Server), try giving path like

<SharePointWebControls:CssRegistration name="<% $SPUrl:~sitecollection/Style Library/SiteName/style.css %>" runat="server"/>
  • Thank you for your answer. The pipeline article was interesting, but I didn't find anything about how to access the Style Library in it. Did I miss it?
    – ksnortum
    Feb 8, 2012 at 18:44
  • I am not publishing the sites; they are Intranets. I did try this markup to get to the Style Library: <SharePoint:CssRegistration name="<% $SPUrl:~sitecollection/Style Library/SiteName/style.css %>" runat="server"/>, but I got the exact same error as before (same URL path and everything).
    – ksnortum
    Feb 8, 2012 at 18:49

$SPUrl is part of the publishing infrastructure, and so will not work on Foundation or if publishing is not activated.

  • 1
    This would make a good comment, rather than an answer.
    – Hugh Wood
    Nov 15, 2012 at 8:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.