How to install a "Code Project" packge/plugin in Visual Studio 2015? - c#

I have found the FTPFactory Code Project, and I want to test drive it. However, so far I only installed new packages via Nuget. How do I add FTPFactory to my Solution in Visual Studio 2015?

You have 2 options.
Since this is such a simple single class library, you could just manually copy the ftp.cs file from the source and add it to your project.
Alternately, you can download and build the project which will produce a FTPTest.dll file. You can add a reference (browse) to this file in your project and use the class form there.

Related

How to add a c# project as a resource in a class library c# project?

I have been working on a class library that generates c# projects from an existing c# project. Right now I have the template project in a specific folder on my machine but what I really need is to add that template project to the class library as a resource, so I could distribute the dll. Any suggestion will be very helpful.
If I'm understanding this correctly, and you're saying you've got a project that produces new C# projects (so .csproj and .cs files) and you want to add those as a resource, then I'd zip them up and add the zip as a resource.
Also have a look at the way new templates in Visual Studio are distributed. Within Visual Studios program files you'll find the built-in templates for example "C# Console Application" and "VB.NET WinForms" in the default path "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\ProjectTemplates", however you can always download new ones from online and add them to Visual Studio, I'm guessing they could be zip or some form of packaged file.
There's information from Microsoft on how to create your own project templates and mentions about zipping them up https://learn.microsoft.com/en-us/visualstudio/ide/how-to-create-project-templates?view=vs-2017
There's also a guide here on how to create your own project templates https://www.ecanarys.com/Blogs/ArticleID/180/Create-custom-project-templates-in-Visual-Studio
Having a look around at distributed project templates, they mostly come from the Visual Studio Marketplace.
Video 18 of this series on the Microsoft Virtual Academy might help you.
Creating and Adding References to Assemblies
https://mva.microsoft.com/en-US/training-courses/c-fundamentals-for-absolute-beginners-16169?l=Ry6jz0QIC_5706218949

Hide files with some extension (dll) in visual studio solution explorer

I have a VS2017 solution and project which is displaying these core dll libraries in solution explorer, which pollutes the view.
The dlls are included via a .targets file included in a 3rd party nuget package.
I know this because when I try right click item -> remove, I get error prompt:
Cannot modify an evaluated object originating in an imported file
"....nuget\packages\some.third.party.package\1.0.0\some.third.party.package.targets"
Obviously, best thing to do would be to solve root problem and not include these dlls files in msbuild targets file, however let's assume I cannot remove/modify/update this 3rd party library and it is necessary to use.
How can I configure Visual Studio (2017) to not show these dlls? Some way to filter the view is a good enough fix for me.
How can I configure Visual Studio (2017) to not show these dlls? Some way to filter the view is a good enough fix for me.
To my knowledge, there is no such configure Visual Studio (2017) to hide those dlls. Because those files are included via a .targets file included in a 3rd party nuget package, we could not handle those dll files directly. In addition, you also have no control over this third party package.
So I am afraid you could not hide those dll files in Visual Studio 2017 without manipulating dlls files directly.

How do I use RedditSharp in Visual Studio (2012)?

I am making a C# Web Form application and I want to use RedditSharp. https://github.com/SirCmpwn/RedditSharp
I've never used an API in C#, this would be my first time using something outside of the C# generics. Could someone help me understand how to import it to use it?
Create C# Web Forms project in Visual Studio
Download RedditSharp code from Github
Compile RedditSharp into DLL (build enclosed solution, grab DLL from the bin/release folder or wherever it builds to)
Add a reference from your project to RedditSharp DLL
Check examples at https://github.com/SirCmpwn/RedditSharp, add something like that to your code
Don't forget to add "using RedditSharp;" to the top of your code file.
Easiest thing to do in Visual Studio is to install the nuget package. Go to Tools...Nuget Package manager... Manage Packages for Solution. Search for RedditSharp, click install.
Now you can reference it from anywhere in your project by adding:
using RedditSharp;
This has the added benefit of Visual Studio alerting you to new updates anytime the official RedditSharp project is updated.

Cannot build C# project in Visual Studio

I am an experienced developer who is completely new to C# and windows development.
I would like to contribute to Rocksmith custom song creator with a simple feature, but I don't even know how to build and run the project in Visual Studio 2012. I cloned the git repository, double clicked on devtools/devtools.csproj then Debug -> Start Debugging but I get an error about not being able to start a class directly.
You can browse the source code of the project at: https://code.google.com/p/rocksmith-custom-song-creator/source/browse/
From what I can tell, you have selected a sub-project in your solution to be the starting-project.
See, if there is project that defines a Window (WinForms or WPF), right-click this project and select it as starting project.
From MSDN
You can specify which project or projects within a multi-project solution Visual Studio will build and debug first.
To set a single startup project
In Solution Explorer, select the desired startup project within your solution.
On the Project menu, choose Set as StartUp Project.
The .csproj is just a project, you need to put that into a Solution (or open the solution included, if any)
Do you have a .sln file? Probably that's the one you must open.

How to use open source library in C#?

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/

Categories

Resources