Complile A DLL From Github - c#

I have found a great dev on github who has some great code i am using at the moment. I need to edit one of the files referenced in the DLL (that i referenced from nuget).
https://github.com/flagbug/YoutubeExtractor
luckily the dev has all the .cs files available on github to download. I have made the changes i need to his code but have no idea on how to compile them into a dll for use in my project.
What should i start researching - it is something i have never even remotely had to do before. If anyone has a link to a guide i could follow or a good starting point to learn from i would appreciate it.
thanks!

Start by downloading the project from GitHub. Then open the solution file in Visual Studio and make the necessary changes to the source code. Then compile. Finally reference the compiled assembly into your application (don't use the official NuGet).
Or if you want to use the NuGet you will have to build it by yourself with the changes you have made to the source code and then reference the new NuGet.
After you have completed those changes you might submit a Pull Request to the author on GitHub so that he can integrate your changes directly into his repository and make them available through his NuGet.

Related

Step through code in a referenced solution

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.

TagLib is not working [duplicate]

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. :)

Working with Sqlite.dll error

I am trying to make a small application, working with SQLite. However I am running into problems whose solutions on the Net are horribly outdated and nothing I tried works, currently I feel like I have no idea what I am doing.
My problem:
Can't add a reference to SQLite.dll "A reference to sqlite3.dll could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component."
What I've tried:
As far as I know in order to use SQLite in C# code I need to add a reference to an SQLite.dll. I went to the Downloads page of SQLite and downloaded precompiled binaries for Windows (mainly because I have no idea what any of those things are). That didn't work, searched on the 'Net:
Tried both the x32 and x64 version
Installed "SQLite for Windows Runtime" extension
Installed SQLite tools, included them in PATH variable
The only *.dll I could get going was from a Codeproject example which had a sqliteNet.dll file (I have no idea from where) but that had other problems.
From what I looked for all the information/questions/tutorials about SQLite on the Net are horribly outdated and are no help to me.
Currently I am literally lost and have NO idea why it doesn't work and what I should do, please someone help me!
can you use the nuget package for sqlite "System.Data.SQLite"?
Since you need a wrapper to the c-dll you should try some nuget package that wraps it already.
If you haven't tried this method then you have to test it.
Right Click on your Project
Click on Manage NuGet Packages..
In Browse tab search System.Data.SQLite & select it
On Right side click on Install button
After installing you can use it

How do I use taglib-sharp?

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. :)

(UWP) Linking the VKontakte SDK in Visual Studio

I'm currently developing an app that makes use of the VK API and so far I've been rolling my own in terms of API calls, but I think that going forward, using their SDK might be favorable.
Their documentation, however only says to "add a link" to the SDK and contains a link to a github page (see https://vk.com/dev/wp_sdk)
As someone who hasn't worked with SDKs before, I'm sure I'm missing something really obvious, but how would I go about adding this link without a wizard like NuGet?
Thanks!
I believe you should download a project from github page, and copy project "VK.WindowsPhone.SDK" to your solution, and then reference it in your solution.
Another option is: open it in visual studio, then build it yourself. Then just take the libraries generated by compiler to your application folder, then reference them using "Add Reference" - specifically that VK.WindowsPhone.SDK.dll

Categories

Resources