After a successful install, I have created my first a document type called NewsLine. It has 3 the following Generic properties (Title (text), Contents (RTE) and Article Date (DatePicker)
I wish to create a C# console application to populate the associated Umbraco table with 10,000 rows of data.
Does anyone have a C# asp.NET LINQ example stub to get me started.
Thank you very much for the link. However, I am having trouble with the console application.
After changing the umbracoDbDSN connection string I recompiled the console application and ran it. It worked!
Note: Iam using VS 2013.
But when I ran it the second thrid time, my VIsual Studio debugger errored out on this line.
{"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"}
I went to Task Manager and thought maybe there was something loaded that did not get unlaoded when I stopped the debugger. I found UmbConsole.vshost.exe file hanging around. But when I deleted it, it came back.
C# LINQ and Umbraco
Hi:
I'm new to Umbraco.
After a successful install, I have created my first a document type called NewsLine. It has 3 the following Generic properties (Title (text), Contents (RTE) and Article Date (DatePicker)
I wish to create a C# console application to populate the associated Umbraco table with 10,000 rows of data.
Does anyone have a C# asp.NET LINQ example stub to get me started.
Thanks
Hi Tom,
You can easily use Umbraco Services for retrieving and manipulating data from Umbraco.
http://our.umbraco.org/documentation/Reference/Management-v6/Services/ContentService
Thanks
Hi Tom,
I've not used it but there is a example console application here that uses the ContentService to create content.
Jeavon
jeavon:
Thank you very much for the link. However, I am having trouble with the console application.
After changing the umbracoDbDSN connection string I recompiled the console application and ran it. It worked!
Note: Iam using VS 2013.
But when I ran it the second thrid time, my VIsual Studio debugger errored out on this line.
{"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"}
I went to Task Manager and thought maybe there was something loaded that did not get unlaoded when I stopped the debugger. I found UmbConsole.vshost.exe file hanging around. But when I deleted it, it came back.
Have you seen this?
What can I do?
Thanks
Tom
Oh I am using Umbraco 7 and code fails on this line.
protected override void InitializeApplicationEventsResolver()
{
base.InitializeApplicationEventsResolver();
}
To start I would suggest updating the UmbracoCms.Core NuGet package to v7.2.1 as a lot has changed since v7.0.2 and see if it still compiles...?
Jeavon:
Actually I am on 7.2.1. The code compiles and runs great the first time. After that, I'm getting the above mentioned VS error.
I realinze you did not write the code and was only being helpful. But have you tried running the code?
Thanks
Tom
is working on a reply...