Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Add reference to an added project

Posted on 2010-11-21
11
Medium Priority
?
303 Views
Last Modified: 2012-05-10
Hi Experts,

I want to use the following downloaded classes in my own project:

https://github.com/moserware/Skills/tree/master/Skills/

I have downloaded them and added the 'Skills' project to my own 'WindowsFormsApplication1'. My IDE is telling me I need to reference the Mouserware.Skills.TrueSkill namespace contained in the downloaded and added Skills project. How do I add this reference when I go to Project | Add Reference | .Net I do not see anything to do with the Skills project listed.
0
Comment
Question by:DColin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 3
11 Comments
 
LVL 3

Expert Comment

by:abdkhlaif
ID: 34182790
in the 'Add Reference' dialog, click 'Browse' tab then choose your dll
more details at:
http://msdn.microsoft.com/en-us/library/ftcwa60a(VS.90).aspx
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 34182832
If you have added to the project to your current solution then in the "Add References" dialog switch to the "Projects" tab and add the reference from there.
0
 

Author Comment

by:DColin
ID: 34182995
abdkhlaif:

Neither of the two projects have a dll.

carl_tawn:

When I open the 'Add References' dialogue I do not see any reference to the downloaded and added 'Skills' project. Error
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 52

Expert Comment

by:Carl Tawn
ID: 34183002
Can you post a screen grab of the Add References dialog with the "Projects" tab selected?
0
 
LVL 3

Expert Comment

by:abdkhlaif
ID: 34183051
if you downloaded the source code only, you will need to build the project to generate the dll then add reference to it
0
 

Author Comment

by:DColin
ID: 34183123
1 2 3
0
 
LVL 3

Expert Comment

by:abdkhlaif
ID: 34183209
if you downloaded the source code only, you will need to build the project to generate the dll then add reference to it
0
 

Author Comment

by:DColin
ID: 34183233
Hi abdkhlaif

Why is the downloaded project's source code different from my project's source code?
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 34183270
That isn't the "Projects" tab, that's the ".Net" tab. You need to switch the Add Reference to the "Projects" tab, third from the left in your image.

The .Net tab only shows assemblies that are registered in the GAC, which your project isn't. You also don't need to build the project first. When you add a reference to the project it's DLL will be built along side your project and a copy of the resulting DLL will be copied with your project automatically.
0
 
LVL 3

Assisted Solution

by:abdkhlaif
abdkhlaif earned 600 total points
ID: 34183277
there are two ways to use the classes in the Skills project:
1. using the binary (Skills\bin\Release\Moserware.Skills.dll)
in this case you will need to:
- obtain Moserware.Skills.dll either by downloading from github website or by building the Skills project to generate the dll
- then add a reference to the dll in your project

2. using the source code:
in this case you don't need the dll file, but you need to add the class files (*.cs) to your project instead.
For example, to add the 'Guard' class:
- right click your project in the Solution Explorer then click Add -> Existing Item
- browse and select Guard.cs file

in both cases you will need to add:
using Moserware.Skills;
to your code
0
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 1400 total points
ID: 34183297
>>  in this case you don't need the dll file, but you need to add the class files (*.cs) to your project instead.

Erm, no you don't. In fact that is pretty much the last thing you want to be doing.

The class "Skills" project you have added to your solution is already a class library project in itself, which you can reuse across projects. If you add all the class files to your existing Windows Application project then you lose that re-use.

as I have already said, you simply need to add a reference to the class library project; either by building it first and adding a reference to the DLL (in this case there is very little point in keeping Skills in the same solution) or you add a reference to the project (as i have already described) and then it will be built along side your Windows Application project.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question