Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm developing dll that will do some functionalities in umbraco. The dll execution is in the bin folder of umbraco page. I'm trying to get all document types from the database and do something with it. How do I initialize IContenttypeService?
protected static string umbracoConStr;
protected static IContentTypeService contentTypeService;
public UmbracoData(string path1)
var webConfigPath = Path.Combine(path1, "..", "Web.config");
XDocument xdoc = XDocument.Load(webConfigPath);
umbracoConStr = xdoc.Element("configuration").Element("connectionStrings").Elements("add").Where(c => c.Attribute("name").Value.Equals("umbracoDbDSN")).FirstOrDefault().Attribute("connectionString").Value;
//here I need to initialize contentTypeService somehow. PLEASE HELP
public static Dictionary<int,string>GetAllDocumentTypes()
var contentTypes = contentTypeService.GetAllContentTypes();
var dt = new Dictionary<int, string>();
foreach (var ct in contentTypes)
Anybody? this should be similar like Chauffeur is working just not from command line but from application with interface
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted