umbraco-console-example icon indicating copy to clipboard operation
umbraco-console-example copied to clipboard

System.NullReferenceException on using uQuery.GetNodesByXPath() and uQuery.GetNodesByType()

Open gcapnias opened this issue 10 years ago • 0 comments

Whenever I try to use uQuery.GetNodesByXPath() and uQuery.GetNodesByType(), I get an System.NullReferenceException:

Object reference not set to an instance of an object.
   at umbraco.uQuery.GetNodesByXPath(String xpath)
   at Umbraco.Console.Program.Main(String[] args) in c:\Projects\dotSee\Moca\Umbraco-v.6.0.1\Umbraco.Console\Program.cs:line 49
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Although, when I use uQuery.GetNode() it works without any problem.

Any ideas why? Can uQuery be used in console?

Thanks in advance, George J.

gcapnias avatar Mar 01 '15 16:03 gcapnias