How to use in .Net core console application
Hi,
I tried to use your code for a console application, but unfortunately I failed on project.json. I copied nearly everything from your check in web.app project.json but VS can not resolve the dependencies, I have no idea why ;(
And idea?
@SharpNoiZy should work without problem, I'll create a demo
Greetings Damien
Here's a working demo https://github.com/damienbod/AspNetCoreNlog/tree/consoleDemo/src/ConsoleNLog greetings Damien
@SharpNoiZy Is this ok now?
Greetings Damien
@damienbod First of all thank you very much for doing that just for me!
But it seems, that something is wrong with my ASP.NET Tools Preview 2 installation. It doesn't work for me.


The strange thing is, I have an own .NET Core Console app (Startet to implement your code) where I can add the following packages without issues:

But as soon I add NLog it doesn't work. ;(
@SharpNoiZy I'm using this version as well. strange. Try deleting the project.lock.json and check that the global.json is using the right version.
Greetings Damien
There are no project.lock.jsons
That's what happens if I try dotnet restore

This IP is our company internal nuget server, it's clear that he will not find the package there, but why is he searching there anyway?? And it seams that he is only searching there...
Try adding the NuGet feed and move to the top, this is deactivated.Tools/NuGet Package Manager/NuGet Package Settings/Package sources
You need this source https://api.nuget.org/v3/index.json
Is there, otherwise I could install no packages at all, but that it not the case, just with your solution, and NLog in particular. Newtown.JSON is no problem!

NLog is a pre-release package. Is this allowed?
Packages are public: https://www.nuget.org/packages/NLog.Extensions.Logging/
If you can tell me how to allow/disallow, I know just the checkbox inside the GUI, but with Powershell there is no GUI involved.
I did "dotnet restore" not "Install-Package NLog.Extensions.Logging -Pre"
FYI, there is also a tutorial here: https://github.com/NLog/NLog.Extensions.Logging/wiki/Getting-started-with-.NET-Core-2---Console-application