TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
shoeb sayyed
NA
4
0
How to Apply theme to a sharepoint site using WCF service?
Oct 4 2011 3:53 AM
I am trying to apply a theme to a sharepoint site.
my method is as follows :
public void ApplyCustomeTheme(string url, string themeName)
{
using (SPSite oSite = new SPSite(url))
{
using (SPWeb oWeb = oSite.OpenWeb())
{
System.Collections.ObjectModel.ReadOnlyCollection<ThmxTheme> oThemes =
ThmxTheme.GetManagedThemes(oSite);
// list out all themes of this particular site
foreach (ThmxTheme oTheme in oThemes)
{
// Apply my custom theme to the current website
if (oTheme.Name == themeName)
{
ThmxTheme.SetThemeUrlForWeb(oWeb, oTheme.ServerRelativeUrl);
}
}
}
}
}
but when i try to run the WCF client i get the following error:
Could not load file or assembly 'Microsoft.SharePoint.Search' or one of its dependencies. An attempt was made to load a program with an incorrect format.
I have included the
'Microsoft.SharePoint.Search' dll
in the
References
.
Can some one please explain me what is causing this ?. Is it because of serialization ?
Can i get a solution on this ?
Shoeb Sayyed
Attachment:
applycustomthemesvc.zip
Reply
Answers (
1
)
Adding nodes to top navigation bar using object model
Infopath task edit form for SharePoint 2010 sequential Workflow