2007-07-31

The file or folder name contains characters that are not permitted. Please use a different name.


Creating a new site based on a custom site definition, you get the above error.

 

Cause: This error is caused by one of the aspx files in your site definition referencing and invalid master page. ei not default.master

 

Work Around: The only work around I've found is to put your custom master page in the masterpage library of the top site.

 

Even if the master page exists in both \Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\GLOBAL & LAYOUTS it will not work.




Update:
OK had this issue again and its caused by the SP dll not finding the master page defined in the aspx page.

The fix is to make sure it can.

Options:

  • Put the masterpage at the site collection level, use it's absolute path (/_catalogs/masterpage/new.master or ~sitecollection/_catalogs/masterpage/new.master)
  • Use a site local masterpage library and use (~site/_catalogs/masterpage/new.master)
  • 9 comments :

    1. hi, I was able to fix this error.

      it occurs because of this part in code:
      MasterPageFile="~masterurl/default.master"

      when you try to put other master page, the "~" sign is throwing error.

      to get around the problem, simply change the URL to:
      MasterPageFile="_catalogs/masterpage/MyMaster.master"
      this will read the master page directly from the folder and won't throw errors anymore.

      ReplyDelete
    2. Yahav: Makes sense. This was a long time ago when I was just learning SP... so I didn't even know what I was talking about.

      ReplyDelete
    3. Cheers Ray, thanks for getting back and I hope this will help others as well. :-)

      ReplyDelete
    4. You should use the sitecollection token to reference the masterpage catalog, like this:
      MasterPageFile=>~sitecollection/_catalogs/masterpage/mymaster.master"

      this way you can leverage the page in other site collections

      ReplyDelete
    5. Thanks, I had the similar issue and it is good to see other people posting about this stuff and not have the "oh I did something wrong and i don't know what it is..." deal.

      ReplyDelete
    6. David Kreth Allen28 March, 2009 21:49

      FYI, I tried
      "~masterurl/mymaster.master" and it did not work.

      Then I tried
      "_catalogs/masterpage/MyMaster.master" and it ALSO did not work.

      But
      "~sitecollection/_catalogs/masterpage/mymaster.master"
      DID work. Thanks Rich. I would never have even known about that.

      ReplyDelete
    7. If the page is in your sub site then it will work and it will also use the ghosted page if the page is not customized.

      _catalogs/masterpage/defaultNew.master

      ReplyDelete
    8. I have the same problem and this happen when create new workspace then select publish tab then select collboration.
      Please Help

      ReplyDelete
    9. thanks, it helped me to resolve master page deployment issue :)

      ReplyDelete