?
Solved

Add reference to an added project

Posted on 2010-11-21
11
Medium Priority
?
301 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
Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

 
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

AWS Certified Solutions Architect - Associate

This course has been developed to provide you with the requisite knowledge to not only pass the AWS CSA certification exam but also gain the hands-on experience required to become a qualified AWS Solutions architect working in a real-world environment.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

764 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