-
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
Error when deploy web with NLog.Web.AspNetCore on IIS #229
Comments
I think there should be an exception, but it's very high level. Could you check the internal log? https://github.com/NLog/NLog/wiki/Internal-logging |
I have activated the trace level and this is the result. 2017-12-04 16:43:35.0488 Trace Scanning LevelLayoutRenderer 'Layout Renderer: ${level}' |
Hi, I have debugged the error. The program stops when:
The whole class is: private static void ConfigureHiddenAssemblies()
{
//ignore this
LogManager.AddHiddenAssembly(Assembly.Load(new AssemblyName("Microsoft.Extensions.Logging")));
LogManager.AddHiddenAssembly(Assembly.Load(new AssemblyName("Microsoft.Extensions.Logging.Abstractions")));
try
{
//try the Filter ext
var filterAssembly = Assembly.Load(new AssemblyName("Microsoft.Extensions.Logging.Filter"));
LogManager.AddHiddenAssembly(filterAssembly);
}
catch (Exception)
{
//ignore
}
LogManager.AddHiddenAssembly(typeof(ConfigureExtensions).GetTypeInfo().Assembly);
}
} Any idea about how to solve it? |
there should be an exception. Please use the debugger of Visual Studio. |
The problem is a dependency on "Microsoft.Extensions.Logging.Filter". I have added it manually using nuget and it works, but I don't understand the reason... The line which the exception thows is : |
is there no Microsoft.Extensions.Logging dll in your project? |
there should be a strack trace and exception title/message. see https://stackoverflow.com/questions/116896/visual-studio-how-to-break-on-handled-exceptions |
I havent a explicit reference to Microsoft.Extensions.Logging. But I in some coworkers pcs it works without it. The same happen with the example of github, so I supposed that I have something wrong in my installation of .net Core. |
@304NotModified Guess a helper method could be made, then one would also get better exception logging:
But it is probably a bug in the nuget-package cache @joscalv |
@snakefoot yes I think this is needed, thx for the snippet! |
A more robust way of hiding the assembles has been added to rc2 |
Hi All,
I have develop a test and use the example "ASP.NET Core 2 - VS2017" of the repo, to use Nlog in ASP .Net Core, using the package NLog.Web.AspNetCore rc1, but when I execute the solution over IIS instead IIS Express the solutions stops without throw an exception.
The software fails in this line:
Thanks!
The text was updated successfully, but these errors were encountered: