I have a legacy project which does not have logging mechanism. I'm trying to install Nlog 2.0 in it but to no avail. It does not show up in the package manager search results. I tried the NLog page which took me this CodePlex page. And when I download the archive, I do not see the .exe files when I unzip the zip package. Any help is appreciated.
Asked
Active
Viewed 622 times
0
-
There wouldn't be .exe files. NLog is a class library, so it would be a .dll file. The standard way to distribute class libraries in .NET is via NuGet. You said you looked in Package Manager but didn't see anything. Are you sure you have the correct package source configured? Are you able to see other NuGet packages there? – mason Jun 21 '19 at 20:40
-
My bad. I had not installed Nuget Manager and was searching in extension manager. Now i'm able to find Nlog but it is version 4.6.5. I'm looking for Nlog 2.0 since it is the only one compatible with 2010 right? – Vinny Jun 21 '19 at 20:54
-
Visual Studio 2010 is an IDE. Libraries you choose don't have to be compatible with your IDE, they have to be compatible with your application framework. What .NET Framework version are you using for your app? Anyways, NLog 4.6.5 is compatible with .NET all the way back to 3.5. You can see that by viewing it on [FuGet](https://www.fuget.org/packages/NLog/4.6.5). – mason Jun 21 '19 at 20:55
-
The solution uses .Net Framework 4 Client Profile and when i try to install Nlog 4.6.5 it says 'NLog' already has a dependency defined for 'NETStandard.Library'. – Vinny Jun 21 '19 at 21:03
1 Answers
0
NLog 2.1 is also on NuGet? (latest NLog 2 version). See https://www.nuget.org/packages/NLog/2.1.0
You could also download it manually and unzip it.
I'm looking for Nlog 2.0 since it is the only one compatible with 2010 right?
Visual Studio supports .NET 2 - 4.0, so you also could pick the latest NLog version (4.6.5)

Julian
- 33,915
- 22
- 119
- 174
-
Because you recommended NLog 2.1, without an apparent reason. And you advocated manual package management, which is a pretty maintainable solution. – mason Jun 21 '19 at 20:57
-
So? Why do you think it needs to be NLog 2? And why would you recommend manually downloading the package file an unzipping it instead of using NuGet the way it's intended to be used? – mason Jun 21 '19 at 20:59
-
2
-
I tried this and it says "Install-Package: Unable to find version '2.1.0' of package 'Nlog' ". Same thing for other 2.0 versions – Vinny Jun 21 '19 at 21:01
-
@Julian I'm specifically asking you why you think that it's necessary to use NLog 2.1. And why you're not handling NuGet packages in the standard way. It's your answer, you need to justify it if you're going to make these assertions. – mason Jun 22 '19 at 00:20
-
@mason VS2010 Cannot handle the update nuget-package-format. Probably why he recommends download and unzip. Curious why you don't make your own answer instead of jumping on this one :) – Rolf Kristensen Jun 22 '19 at 10:53
-
@mason, so i could not install 2.1 or 2.0 before because i actually realized i need to install Nuget package manager first before installing Nlog. After i install Nuget, i still could not install the latest Nlog 4.6 as it is not compatible with VS 2010. I ended up installing Nlog 4.0 using jasons answer. – Vinny Jun 24 '19 at 17:36
-
@Vinny When you say "not compatible", what do you mean? Did you get an error message? What was the specific error message? – mason Jun 24 '19 at 17:37
-
-
@mason:the error says 'NLog' already has a dependency defined for 'NETStandard.Library' – Vinny Jun 25 '19 at 21:28
-
-
-
@Vinny about the error - check https://stackoverflow.com/questions/25725545/nuget-x-already-has-a-dependency-defined-for-y. – Julian Jun 25 '19 at 21:31