Solved

Add reference to an added project

Posted on 2010-11-21
11
296 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
  • 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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 150 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 350 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Please explain: Aspect Oriented Programming 2 55
Trouble with References... 5 25
Long URL in SMS 6 24
Getfiles in vb.net 28 22
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

759 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now