-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix aspnet-session failing tests #26
Conversation
@@ -23,6 +24,7 @@ public AspNetSessionValueLayoutRendererTests() | |||
|
|||
public void SetUp() | |||
{ | |||
ConfigurationItemFactory.Default.LayoutRenderers.RegisterDefinition("aspnet-session", typeof(AspNetSessionValueLayoutRenderer)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be needed if nlog 4.0.1+ is used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used both the resharper xunit test runner and the ncrunch test runner, and without that, I got
System.ArgumentException: LayoutRenderer cannot be found: 'aspnet-session'
at NLog.Config.Factory`2.CreateInstance(String name)
at NLog.Layouts.LayoutParser.ParseLayoutRenderer(ConfigurationItemFactory configurationItemFactory, SimpleStringReader sr)
at NLog.Layouts.LayoutParser.CompileLayout(ConfigurationItemFactory configurationItemFactory, SimpleStringReader sr, Boolean isNested, String& text)
at NLog.Layouts.SimpleLayout.set_Text(String value)
at NLog.Layouts.Layout.op_Implicit(String text)
at NLog.Web.Tests.LayoutRenderers.AspNetSessionValueLayoutRendererTests.SessionWithCulture()
the packages.config shows NLog 4.0.1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK thanks, I will try to reproduce it locally first.
You have tested it with NLog 4.0.1? Which Visual Studio and Resharper?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested it locally VS2013 update 5+R# 10.0.2: no problem;
Will try VS2015 also
edit: works also in VS2015
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@petemounce please add the following code to the erroneous test case
InternalLogger.LogFile = @"C:\Temp\nlog.web.log";
InternalLogger.LogLevel = LogLevel.Trace;
and post the log :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@304NotModified here you go - it's in petemounce/NLog.Web@2ba53a1921cd675f2885e4413c10a08d02cb2433. I branched from up-to-date master, made the code change, and have posted the log into that commit message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@petemounce I added some comments there. Not sure if you have seen them. If not, I'm not in a hurry, so NP
Current coverage is
|
hey @petemounce, have you seen my comment https://github.com/petemounce/NLog.Web/commit/2ba53a1921cd675f2885e4413c10a08d02cb2433#commitcomment-15895368 ? |
Hi @petemounce , I think I have fixed the root cause with #52 |
No description provided.