I've shortened the code for brevity, but given the following:
SPFile colorFile = web.GetFile(SPUrlUtility.CombineUrl(root, "_catalogs/theme/15/palette011.spcolor"));
SPFile fontFile = web.GetFile(SPUrlUtility.CombineUrl(root, "_catalogs/theme/15/fontscheme002.spfont"));
Uri backgroundUri = new Uri("/_layouts/15/images/image_bg011.jpg");
SPTheme woodTheme = SPTheme.Open("Wood", colorFile, fontFile, backgroundUri);
woodTheme.ApplyTo(web, true);
The SPTheme.Open() method accepts a backgroundUri parameter. It is clearly expecting it to be of type Uri, but I get the error:
Error occurred in deployment step 'Activate Features': Invalid URI: The format of the URI could not be determined.
Why?

0 commentaires:
Enregistrer un commentaire