Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Assembly Reference
Message
De
01/05/2010 03:20:03
 
 
À
30/04/2010 16:09:50
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Novell 6.x
Database:
MS SQL Server
Divers
Thread ID:
01462576
Message ID:
01462617
Vues:
42
>>>>I have a solution with two projects: NSPLogic and NSPWindows. NSPLogic is simply a collection of public classes that are used for business logic. I registered NSPLogic in NSPWindows references, but my forms don't see the classes. I put a using statement--using NSPLogic, but that throws an error when I try to run the project in debug mode. What am I doing wrong?
>>>
>>>The using statement needs to specify the entire namespace, and I'm betting that the namespace of the classes in your NSPLogic project is not simply "NSPLogic".
>>>
>>>~~Bonnie
>>
>>Nope. That wasn't it. Both projects have the same namespace. Could that be the problem?
>
>
>That was the problem. The classes were created in the same project then moved to a new project. I have to change the namespace.

Namespaces have nothing to do with projects so you don't *have* to change the namspace - just specify it correctly in the NSPWindows project. ie. this is perfectly valid:
In NSPLogic:
namespace NSPWindows
{ public class Class1 {} }
and, given a reference to NSPLogic, in NSPWindows:
NSPWindows.Class1 c = new NSPWindows.Class1();
//or just
Class1 c = new Class1();
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform