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.

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.


  • 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)

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

      it occurs because of this part in code:

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

      to get around the problem, simply change the URL to:
      this will read the master page directly from the folder and won't throw errors anymore.

    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.

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

    4. You should use the sitecollection token to reference the masterpage catalog, like this:

      this way you can leverage the page in other site collections

    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.

    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.

      DID work. Thanks Rich. I would never have even known about that.

    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.


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

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