Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 1st, 2008, 12:03 PM
Registered User
 
Join Date: Jun 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Adding references and scope issues

I am trying to reference a class in another project.
I made the classes public.
I then went to the other project and added a reference to the other projects exe and tried to build the solution.

It does not find my namespace or classes.

Any ideas.

 
Old July 1st, 2008, 01:29 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

First off... you don't reference classes, you reference assemblies.
A reference can be project reference or a binary reference. Which are you using?

From the sounds of it you are referencing an EXE. This is not how it is done usually. This might be the source of your problem. You should create a class library instead and reference that from both the EXE and other project(s).

You say "It does not find my namespace or classes." Can you elaborate? Are you getting a build error? What is the error exactly?

-Peter
compiledthoughts.com
 
Old July 1st, 2008, 01:56 PM
Registered User
 
Join Date: Jun 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Peter,

I finally figured out that I needed to create a class library and reference it in my project, etc.

So I learned the hard way.

Thanks for your help.








Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about adding references in vs2008 chobo2 C# 2008 aka C# 3.0 4 December 4th, 2008 07:13 PM
connection string issues, web.config file issues kaliaparijat ASP.NET 2.0 Professional 1 June 12th, 2008 08:07 AM
"Recordset Scope" Nitin_sharma Classic ASP Databases 5 September 23rd, 2004 05:58 AM
Adding Web References to a project.... vb_developer C# 0 September 5th, 2004 01:32 AM
Adding References mahulda ASP.NET 1.0 and 1.1 Basics 0 May 20th, 2004 11:39 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.