- This topic has 8 replies, 2 voices, and was last updated 11 years, 7 months ago by Anonymous.
-
AuthorPosts
-
May 2, 2013 at 15:41 #791AnonymousInactive
I am getting the following NLOG Error when I do
FileTarget _target = new FileTarget();Error: {“LayoutRenderer cannot be found: ‘longdate'”}
StackTrace:
at NLog.Config.Factory`2.CreateInstance(String name) in c:\Users\Karnifexx\Documents\Visual Studio 2010\Projects\networkcomms.net\NetworkCommsDotNet\Tools\PriorityQueueItem.cs:line 0
at NLog.Layouts.LayoutParser.ParseLayoutRenderer(ConfigurationItemFactory configurationItemFactory, SimpleStringReader sr) in c:\Users\Karnifexx\Documents\Visual Studio 2010\Projects\networkcomms.net\NetworkCommsDotNet\Tools\PriorityQueueItem.cs:line 0
at NLog.Layouts.LayoutParser.CompileLayout(ConfigurationItemFactory configurationItemFactory, SimpleStringReader sr, Boolean isNested, String& text) in c:\Users\Karnifexx\Documents\Visual Studio 2010\Projects\networkcomms.net\NetworkCommsDotNet\Tools\PriorityQueueItem.cs:line 0
at NLog.Layouts.SimpleLayout.set_Text(String value) in c:\Users\Karnifexx\Documents\Visual Studio 2010\Projects\networkcomms.net\NetworkCommsDotNet\Tools\PriorityQueueItem.cs:line 0
at NLog.Layouts.SimpleLayout..ctor(String txt, ConfigurationItemFactory configurationItemFactory) in c:\Users\Karnifexx\Documents\Visual Studio 2010\Projects\networkcomms.net\NetworkCommsDotNet\Tools\PriorityQueueItem.cs:line 0
at NLog.Layouts.Layout.FromString(String layoutText, ConfigurationItemFactory configurationItemFactory) in c:\Users\Karnifexx\Documents\Visual Studio 2010\Projects\networkcomms.net\NetworkCommsDotNet\Tools\PriorityQueueItem.cs:line 0
at NLog.Layouts.Layout.FromString(String layoutText) in c:\Users\Karnifexx\Documents\Visual Studio 2010\Projects\networkcomms.net\NetworkCommsDotNet\Tools\PriorityQueueItem.cs:line 0
at NLog.Layouts.Layout.op_Implicit(String text) in c:\Users\Karnifexx\Documents\Visual Studio 2010\Projects\networkcomms.net\NetworkCommsDotNet\Tools\PriorityQueueItem.cs:line 0
at NLog.Targets.TargetWithLayout..ctor() in c:\Users\Karnifexx\Documents\Visual Studio 2010\Projects\networkcomms.net\NetworkCommsDotNet\Tools\PriorityQueueItem.cs:line 0
at NLog.Targets.TargetWithLayoutHeaderAndFooter..ctor() in c:\Users\Karnifexx\Documents\Visual Studio 2010\Projects\networkcomms.net\NetworkCommsDotNet\Tools\PriorityQueueItem.cs:line 0
at NLog.Targets.FileTarget..ctor() in c:\Users\Karnifexx\Documents\Visual Studio 2010\Projects\networkcomms.net\NetworkCommsDotNet\Tools\PriorityQueueItem.cs:line 0
at TradeLink.Common.TLServer_IPv3..ctor(String ipaddr, Int32 port, Int32 wait, Int32 TickBufferSize, DebugDelegate deb, Boolean _delayedStart) in C:\Users\GregJ\Documents-Code\TradeLink-20130107-RickMay\TradeLinkCommon\TLServer_IPv3.cs:line 728
at TradeLink.Common.TLServer_IPv3..ctor(String ipaddr, Int32 port, Int32 wait, Int32 TickBufferSize) in C:\Users\GregJ\Documents-Code\TradeLink-20130107-RickMay\TradeLinkCommon\TLServer_IPv3.cs:line 724
at TradeLink.Common.TLServer_IPv3..ctor(String ipaddr, Int32 port) in C:\Users\GregJ\Documents-Code\TradeLink-20130107-RickMay\TradeLinkCommon\TLServer_IPv3.cs:line 716
at _0_ShotgunTestServerForm.TradeLogic..ctor() in C:\Users\GregJ\Documents-Code\TradeLink-20130107-RickMay-ShotgunTestServerForm\TradeLogic.cs:line 92
at _0_ShotgunTestServerForm.Form1..ctor() in C:\Users\GregJ\Documents-Code\TradeLink-20130107-RickMay-ShotgunTestServerForm\Form1.cs:line 30
at _0_ShotgunTestServerForm.Program.Main() in C:\Users\GregJ\Documents-Code\TradeLink-20130107-RickMay-ShotgunTestServerForm\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()May 2, 2013 at 16:00 #792AnonymousInactiveHeya GregJ,
Got your comment ref the using statements. Completely agree that they should also be given in the article, I’m updating it now.
Regarding your exception can you please tell us what platform, i.e. .net2, .net3.5, ios, …?
Regards,
MarcMay 2, 2013 at 16:13 #794AnonymousInactiveI am using .net4 on windows 7.
May 2, 2013 at 16:59 #795AnonymousInactiveThis is a really strange error, we’ve never had any issues with NLOG in windows. To help debug the problem could you possibly download the source zip bundle, if you have not already, and run the ExampleConsole project (enable logging when prompted) to see if your get the same exception?
Regards,
MarcMay 2, 2013 at 17:41 #796AnonymousInactiveIt worked using the example project. The differences I see are that I am using
NetworkComms within a class in a library I wrote.Then the main application is creating an instance of that class.
I also notice that the ExampleConsole refrences NLOG directly, which I am not able to do from my libarary because it errors out and says the methods are available both in NLOG and NetworkComms.
May 2, 2013 at 17:49 #798AnonymousInactiveSome questions that should find a solution:
1. Are you enabling logging from within your object instance or the top level application?
2. Are you referencing the merged single DLL, i.e. Core/Complete, or the individual DLLs?
3. Can you elaborate what you mean by “I also notice that the ExampleConsole refrences NLOG directly, which I am not able to do from my libarary because it errors out and says the methods are available both in NLOG and NetworkComms.”
Once you reference the NetworkCommsDotNetCore.dll you should be able to add namespace references to NLOG without issues?May 2, 2013 at 17:59 #799AnonymousInactiveI fixed it. I was referencing complete. Changed to Core and then referenced NLOG. Issue resolved.
May 2, 2013 at 18:03 #800AnonymousInactiveBrilliant. Many thanks for the update.
It’s worth noting that the complete DLL already contains NLOG so if you use the complete DLL you should not reference NLOG additionally.
Regards,
MarcMay 18, 2013 at 12:41 #839AnonymousInactiveAfter some further testing I discovered this error is caused by a version bug between .Net4 and .Net4.5 assemblies. The single DLLs were built on a windows 8 machine which turns out was secretly using .Net4.5 assemblies, which then breaks if run on a machine which only has .net4. A quick fix is to use either the .net3.5 or .net2.0 build or install .net4.5 but in the long run we will find a way of ensuring this workaround is not necessary.
-
AuthorPosts
- You must be logged in to reply to this topic.