I'm having a bunch of troubles with this library (obviously because I'm a newbie). I'm using Microsoft Visual Studio 2015.
First of all I have absolutely no idea on how to add this library to my project. I didn't find anything helpful on Google, either.
And second, I've found two different libraries - taglib-sharp-master and taglib-sharp-2.1.0.0-windows. Which one should I use?
There are a few things you'll want to do in order to get taglib-sharp working in your project.
Firstly, you need to stick to a particular project type. Next, you are to install the suitable library version for that project. Next, you can use the library as you wish to. I shall also provide a minimal example to get you started and a link to a bunch of examples which you might find of help.
Choosing the correct version of TagLib:
There's some ambiguity in your question as you have tagged it with both c++ and c#. If you want to use c++ in your project, then your best bet is to use the taglib library. Note: Not the 'sharp' version.
However, almost the entire question and its title speaks of taglib-sharp. Given that, I shall presume that you are using c# for your project. Accordingly, your project is a .NET C# project. You can obviate the quandary over selecting the project type. Any of the project types (WinForms, WPF, Console Application will work just fine as taglib-sharp is just an off-screen library.
And also, FYI, both taglib-sharp-master and taglib-sharp-2.1.0.0-windows are essentially the same stuff. The former is probably the latest version since the latter specifies a definite version 2.1.0.0. But again, 2.1.0.0 has long been the latest version of taglib-sharp. So, use either, and you should be fine.
Installing TagLib-Sharp a.k.a. TagLib#:
Next up, you must install TagLib-Sharp to your project. There are a few ways to do so:
Install it via Nuget
Add a reference to the binary
♦ Installing via Nuget:
This is probably the recommended way of installing any library/component in Visual Studio. Head over to the Nuget Package Manager Console. Once there, type in:
Install-Package taglib
Nuget Package link: Taglib-Sharp.
and press ENTER.
For more information on the Nuget Package Manager Console, how to open it and use it, visit this link.
You can also add it with the help of the Nuget Package Manager (GUI). Open the Package Manager and search for "taglib-sharp". Install the appropriate package that shows in the search results.
For more information on the Nuget Package Manager, how to open and use it, visit this link.
♦ Downloading the binary and adding a reference to it directly:
You can download the latest version of the taglib-sharp binaries here. The download is a .zip archive. Unzip the file.
In the unzipped folder, head over to \Libraries. There, find the taglib-sharp.dll file. Keep a note of where the file is located.
Next, in Visual Studio, go to Project > Add Reference.
There, in the left panel, select Browse. Now in the dialog buttons section, click browse and locate the .dll file you extracted from the .zip archive. Make sure the CheckBox next to it is checked:
Click OK.
Now you are all set to use TagLib-Sharp.
Using TagLib-Sharp (Examples):
The minimal example of using the library would be opening a file and editing its Title property and retrieving the Year property:
var file = TagLib.File.Create("<yourFile.mp3>"); // Change file path accordingly.
file.Tag.Title = "My Own Song";
var year = file.Tag.Year;
// Save Changes:
file.Save();
You can also find a similar example here to get your started.
More examples:
Set Bitmap as cover art for MP3
https://github.com/mono/taglib-sharp/tree/master/examples
https://www.codeproject.com/messages/3009089/extracting-id3-albumart-with-taglib-sharp.aspx
If you have further queries, feel free to ask in the comments below. And also, if the question deserves a separate thread, word it properly and ask it here on Stack Overflow itself.
Hope this answer helps. :)
Related
Usually when I want to debug a nuget package I download the source code and add the .csproj file to my solution and add a project reference instead of using the nuget package. This lets me step through the code and see what is going on with my live project.
I have a nuget package I want to debug but it is very large. I downloaded the source code and the solution has around 20 projects in it. I tried just adding a few of them but ended up with lots of dependency issues.
Is there a way I can tell visual studio that the source code for the nuget package exists on my HD so I can step through it without having to add 20 projects to my current solution? Or perhaps some way to add a reference to the entire solution?
My goal here is to be able to set breakpoints so when the third party compiled code executes I can step through it and see what is going on. What is best way to do this?
Assuming the application is .NET 4.7.2. You could try dnSpy which allows you to debug & edit a built executable/dll.
GitHub Page: https://github.com/0xd4d/dnSpy
Latest Release:https://github.com/0xd4d/dnSpy/releases/download/v5.0.0/dnSpy.zip
Once downloaded
Start up dnSpy.exe for 64-bit or dnSpy-x86.exe for 32-bit applications.
Use File->Open to locate your exe's and dll files.
Apply your breakpoints within dnSpy.
Hit start as you would in Visual Studio
Emcrank has very interesting solution for not having the source code but it wasn't right for me.
The answer for me was actually very simple. When going to add existing project you can change dropdown to add a .sln file. I created a folder then added the solution to it and it pulls everything in with single transaction and now I can easily debug all the code.
so, sorry if this is a stupid question, but I've been working with audio a lot, and I'm going to try out NAudio, so I went to the website (which, by the way, is blocked in Chrome), and downloaded it. Then I searched and searched through the files. Most of the folders don't even include any .dll files, and those that did didn't have one that made sense to reference to. So then I went back to the website and looked around, and I've searched and searched on the internet for things relating to "how to add NAudio to your project" or "How to link NAudio", and I've come up with nothing.
How can I add NAudio to my project?
Run this in your package manager.
Install-Package NAudio -Version 1.8.4
It will automatically add all required reference, you can remove the version flag "-Version 1.8.4" to install latest version
The website you linked to is on Codeplex which is depricated. The current place for NAudio is on github: https://github.com/naudio/NAudio/wiki/Getting-Started
Set a package reference to NAudio on nuget.org: https://www.nuget.org/packages/NAudio/
This will pull in the package and set references to the correct dlls
I'm having a bunch of troubles with this library (obviously because I'm a newbie). I'm using Microsoft Visual Studio 2015.
First of all I have absolutely no idea on how to add this library to my project. I didn't find anything helpful on Google, either.
And second, I've found two different libraries - taglib-sharp-master and taglib-sharp-2.1.0.0-windows. Which one should I use?
There are a few things you'll want to do in order to get taglib-sharp working in your project.
Firstly, you need to stick to a particular project type. Next, you are to install the suitable library version for that project. Next, you can use the library as you wish to. I shall also provide a minimal example to get you started and a link to a bunch of examples which you might find of help.
Choosing the correct version of TagLib:
There's some ambiguity in your question as you have tagged it with both c++ and c#. If you want to use c++ in your project, then your best bet is to use the taglib library. Note: Not the 'sharp' version.
However, almost the entire question and its title speaks of taglib-sharp. Given that, I shall presume that you are using c# for your project. Accordingly, your project is a .NET C# project. You can obviate the quandary over selecting the project type. Any of the project types (WinForms, WPF, Console Application will work just fine as taglib-sharp is just an off-screen library.
And also, FYI, both taglib-sharp-master and taglib-sharp-2.1.0.0-windows are essentially the same stuff. The former is probably the latest version since the latter specifies a definite version 2.1.0.0. But again, 2.1.0.0 has long been the latest version of taglib-sharp. So, use either, and you should be fine.
Installing TagLib-Sharp a.k.a. TagLib#:
Next up, you must install TagLib-Sharp to your project. There are a few ways to do so:
Install it via Nuget
Add a reference to the binary
♦ Installing via Nuget:
This is probably the recommended way of installing any library/component in Visual Studio. Head over to the Nuget Package Manager Console. Once there, type in:
Install-Package taglib
Nuget Package link: Taglib-Sharp.
and press ENTER.
For more information on the Nuget Package Manager Console, how to open it and use it, visit this link.
You can also add it with the help of the Nuget Package Manager (GUI). Open the Package Manager and search for "taglib-sharp". Install the appropriate package that shows in the search results.
For more information on the Nuget Package Manager, how to open and use it, visit this link.
♦ Downloading the binary and adding a reference to it directly:
You can download the latest version of the taglib-sharp binaries here. The download is a .zip archive. Unzip the file.
In the unzipped folder, head over to \Libraries. There, find the taglib-sharp.dll file. Keep a note of where the file is located.
Next, in Visual Studio, go to Project > Add Reference.
There, in the left panel, select Browse. Now in the dialog buttons section, click browse and locate the .dll file you extracted from the .zip archive. Make sure the CheckBox next to it is checked:
Click OK.
Now you are all set to use TagLib-Sharp.
Using TagLib-Sharp (Examples):
The minimal example of using the library would be opening a file and editing its Title property and retrieving the Year property:
var file = TagLib.File.Create("<yourFile.mp3>"); // Change file path accordingly.
file.Tag.Title = "My Own Song";
var year = file.Tag.Year;
// Save Changes:
file.Save();
You can also find a similar example here to get your started.
More examples:
Set Bitmap as cover art for MP3
https://github.com/mono/taglib-sharp/tree/master/examples
https://www.codeproject.com/messages/3009089/extracting-id3-albumart-with-taglib-sharp.aspx
If you have further queries, feel free to ask in the comments below. And also, if the question deserves a separate thread, word it properly and ask it here on Stack Overflow itself.
Hope this answer helps. :)
I'm migrating from Svn externals feature to nuget with a huge project and so far it looks like a bad decision. One of my solution contains 70 projects where most of them contains the same common references (nuget packages).
Previous structure was a common Lib folder per solution which contained all references controlled by svn externals so whenever I wanted to update a version I just updated numbers in tortoise svn and clicked update - quick job.
Currently when I do it from inside Visual Studio it takes 10-20 times longer because I suspect it removes the previous version of package directory from packages, adds new directory, updates packages.config version and updates csproj path. So if I update 7 packages in 70 projects and I have visual studio open it will take much longer. The alternative is to close solution and call nuget update in command-line but it's rather a workaround. Previously path was the same, concept of packages.config didn't exist so the only change was a few lines of code in a text file where we come to the next conclusion - source control changes. Whenever I do an update there is a huge amount of changes which needs to be checked in into source control and I find it a bit messy. I found that there is a flag for nuget install -ExcludeVersion which will exclude version from path so csproj won't be changed and it's a big advantange. Is it a good convention to use it? Is there are support for Visual Studio to use it automatically whenever I install a package? Is there a way to mark a nuget package as "Ignore version in path"? As far as I know the answers for these questions is no, no, no. How do you handle using nuget in bigger projects? Please me know if there is something I can read about nuget how to handle it in bigger projects.
Let's address each issue one by one. Your first question states: Is it a good convention to use it?
This is subject to opinion. If it will break your project to use the ExcludeVersion option on install, then you can't use it. Otherwise, it saves you 70 files on push. The second question states: Is there are support for Visual Studio to use it automatically whenever I install a package?
As far as I can tell (and I may be wrong), there is no way to do this. However, this is going off of quick research, and more information may be found deep inside of the Nuget Config File Defaults (I could not find such a configuration).
I am a little confused as to what you mean by Is there a way to mark a nuget package as "Ignore version in path"?
However, it seems that you mean what Colonel Panic asked in this question: Nuget Packages exclude version in folder naming, in which the answer is no. And lastly, you briefly ask the question: How do you handle using nuget in bigger projects?
Unfortunately, the answer to this question is quite simple: you can't (at least not effectively). Nuget themselves say this in a blog post from October 10, 2014. If you read underneath their "Harmful consequences" section, you can see a lot of the issues that you are running into.
Alright, now onto the solution. I have run into a similar issue with Nuget in the past, and the solution was quite simple. All I had to do to minimize the time was to use Git from command line using Visual Studio's .gitignore (Svn I believe would work too). I know we would all appreciate Nuget to work in these instances; however, this is not the case. As you already use svn, I would suggest not changing. After all, Nuget is really only a macro inside of Visual Studios working on a solution basis.
The answer for my question is project.json. I wasn't aware that I can use it in every project even in WPF. https://oren.codes/2016/02/08/project-json-all-the-things/
I would like to use log4j.net in my windows forms project. However I have never used any library or dll in .NET. How to do it? I look at the site, but I can't find it.
I'm using visual studio 2010.
Add the log4net assembly to your project:
Browse to the log4net downloads page and download the latest log4net archive
(right now the latest version is 1.2.10).
Extract that archive and place the files somewhere to your project
(for example in a folder like yourproject/lib/log4net).
In Visual Studio right click in your project on the References folder and click on Add Reference....
Browse to the folder where your assemblies are (see point 3) and choose the log4net.dll assembly.
Here are some nice basic tutorial for the first steps using Log4Net:
Log4Net Tutorial pt 1: Getting Started
Using Log4Net in 4 Simple Steps
Log error or exception using Log4Net
In your project, you need add a reference to the library, usually by selecting the DLL from the references dialog.
A package manager, NuGet, has been created as an add on to Visual Studio 2010, which lets you select libraries - it will download and set them up for you.
Whichever way you do this, you will now be able to use the library - in a code file, use the using directive to import the namespace, then you can use the classes and other public members of the library in your code (though you could use the fully qualified name every time, if you wish to).
This has nothing to do with a library being open source or not, by the way.
you can easily get now using NuGet package manager in visual studio 2010
Write this command in Package manager console.
Install-Package log4net
See this link
Do you have any specific problems?
Check link below and maybe ask a question if you are stuck on something:
http://sadi02.wordpress.com/2008/06/29/log4net-tutorial-in-c-net-how-can-i-show-log-in-a-file/