I'm making a custom master page with a custom CSS file, being deployed in a feature form VS2010. I'm using the CssRegistation control to add the new CSS, but whenever I try to load a page that uses it, I get an "Illegal characters in path" exception. Which is odd, because there aren't any illegal characters that I can see in the path.
The code I'm using to add the CSS to the page looks like this (from MSDN):
<SharePoint:CssRegistration name="<% $SPUrl:~sitecollection/Style Library/myfolder/mystyle.css %>" After="corev4.css" runat="server"/>
I've check the relevant galleries and the master page is deploying correctly to _layouts/masterpage/mymaster.master, and the CSS is deploying correctly to Style Library/myfolder/mystyle.css.
What have I missed?