(a) connect to m y Umbraco database (b) use Umbraco API to query data.
Can anyone help?
Thanks
Tom
PS I downloaded this console application but it only worked the first time so its of no use. IT failed all other times and gave this error.
{"Could not load types from assembly umbraco, Version=1.0.5133.26615, Culture=neutral, PublicKeyToken=null, errors:\r\nException: System.IO.FileNotFoundException: Could not load file or assembly 'System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.\r\nFile name: 'System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'\r\n\r\n=== Pre-bind state information ===\r\nLOG: DisplayName = System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\n (Fully-specified)\r\nLOG: Appbase = file:///C:/work/fhlb/UmbracoConsole/UmbConsole/bin/Debug/\r\nLOG: Initial PrivatePath = NULL\r\nCalling assembly : System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.\r\n===\r\nLOG: This bind starts in default load context.\r\nLOG: Using application configuration file: C:\\work\\fhlb\\UmbracoConsole\\UmbConsole\\bin\\Debug\\UmbConsole.vshost.exe.Config\r\nLOG: Using host configuration file: \r\nLOG: Using machine configuration file from C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\config\\machine.config.\r\nLOG: Redirect found in application configuration file: 2.0.0.0 redirected to 2.0.0.0.\r\nLOG: Post-policy reference: System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\r\nLOG: Attempting download of new URL file:///C:/work/fhlb/UmbracoConsole/UmbConsole/bin/Debug/System.Net.Http.DLL.\r\nLOG: Attempting download of new URL file:///C:/work/fhlb/UmbracoConsole/UmbConsole/bin/Debug/System.Net.Http/System.Net.Http.DLL.\r\nLOG: Attempting download of new URL file:///C:/work/fhlb/UmbracoConsole/UmbConsole/bin/Debug/System.Net.Http.EXE.\r\nLOG: Attempting download of new URL file:///C:/work/fhlb/UmbracoConsole/UmbConsole/bin/Debug/System.Net.Http/System.Net.Http.EXE.\r\n\r\n"}
using Umbraco.Core.Models;
using Umbraco.Core.Services;
Then you will of course need to make some references to the Umbraco .dll files from the /bin/ folder in your Umbraco installation as well.
After the new API's have launched I'm not sure, which ones to refer though but usually interfaces.dll, umbraco.dll and cms.dll will be used. Potentially others as well though.
Then in your application you will probably need to define a connectionstring to the umbraco database as well in your web.config file.
using API to Query Content
I am working in VS.net 2013 Console application.
I am using Umbraco 7,2.1.
I need help in
(a) connect to m y Umbraco database
(b) use Umbraco API to query data.
Can anyone help?
Thanks
PS I downloaded this console application but it only worked the first time so its of no use. IT failed all other times and gave this error.
{"Could not load types from assembly umbraco, Version=1.0.5133.26615, Culture=neutral, PublicKeyToken=null, errors:\r\nException: System.IO.FileNotFoundException: Could not load file or assembly 'System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.\r\nFile name: 'System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'\r\n\r\n=== Pre-bind state information ===\r\nLOG: DisplayName = System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\n (Fully-specified)\r\nLOG: Appbase = file:///C:/work/fhlb/UmbracoConsole/UmbConsole/bin/Debug/\r\nLOG: Initial PrivatePath = NULL\r\nCalling assembly : System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.\r\n===\r\nLOG: This bind starts in default load context.\r\nLOG: Using application configuration file: C:\\work\\fhlb\\UmbracoConsole\\UmbConsole\\bin\\Debug\\UmbConsole.vshost.exe.Config\r\nLOG: Using host configuration file: \r\nLOG: Using machine configuration file from C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\config\\machine.config.\r\nLOG: Redirect found in application configuration file: 2.0.0.0 redirected to 2.0.0.0.\r\nLOG: Post-policy reference: System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\r\nLOG: Attempting download of new URL file:///C:/work/fhlb/UmbracoConsole/UmbConsole/bin/Debug/System.Net.Http.DLL.\r\nLOG: Attempting download of new URL file:///C:/work/fhlb/UmbracoConsole/UmbConsole/bin/Debug/System.Net.Http/System.Net.Http.DLL.\r\nLOG: Attempting download of new URL file:///C:/work/fhlb/UmbracoConsole/UmbConsole/bin/Debug/System.Net.Http.EXE.\r\nLOG: Attempting download of new URL file:///C:/work/fhlb/UmbracoConsole/UmbConsole/bin/Debug/System.Net.Http/System.Net.Http.EXE.\r\n\r\n"}
Hi Tom
Have you checked out the Managet API's here? http://our.umbraco.org/documentation/Reference/Management-v6/ There is a lot of information about the API's.
Hope this helps a bit.
/Jan
Yes I have that but its not clear to me how to connect to Umbraco.
Hi Tom
Aaah...Well I think that if you have a look at for instance http://our.umbraco.org/documentation/Reference/Management-v6/Models/Content then it show what should be referenced in the using statements like
using Umbraco.Core.Models; using Umbraco.Core.Services;
Then you will of course need to make some references to the Umbraco .dll files from the /bin/ folder in your Umbraco installation as well.
After the new API's have launched I'm not sure, which ones to refer though but usually interfaces.dll, umbraco.dll and cms.dll will be used. Potentially others as well though.
Then in your application you will probably need to define a connectionstring to the umbraco database as well in your web.config file.
Hope this makes sense.
/Jan
is working on a reply...