[dba-VB] Projects vs Solutions

Shamil Salakhetdinov shamil at smsconsulting.spb.ru
Wed Nov 18 13:35:05 CST 2009


Hi John --

In fact referencing other projects works very well in .NET, and it's clean
and very useful: just note that 'using' directive is to refer to
*namespaces* not to projects. If you right-click a project in Solution
Explorer, and then select 'Properties' you can find that every project has
'Default Namespace', which is usually the same as project name but this is
not necessary.

When I'm developing my solution and I need "to get work done" I do sometimes
postpone creating new projects within a solution - I just create subfolders
in my main project's treeview and I put my code to be later moved to other
projects into those subfolders, and I keep namespace for those subfolders
different from the default project's namespace - check it out...

You'll soon get fluent with that namespaces and projects stuff and then
you'll be "cooking" new projects seamlessly - it's usual story to have 10+
projects within .NET solutions...

<<<
When I try to do "Using projOther1;" from 
inside of ProjMain it says that ProjOther doesn't exist.
>>>
Do you have 'ProjOther' within  your solution?
Did you set reference to 'ProjOther'?
Does 'ProjOther''s default namespace is 'ProjOther'?

'using' directive should be started with lowercase letter.... 

Thank you.

--
Shamil

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Wednesday, November 18, 2009 9:55 PM
To: Discussion concerning Visual Basic and related programming issues.
Subject: Re: [dba-VB] Projects vs Solutions

Using projOther doesn't work.

When doing this is the project allowed to be a part of the solution?  Is it
even SUPPOSED TO BE a 
part of the solution.  IOW are you supposed to create projects as separate
entities and then 
reference them from other projects, or can you create SolutionMain /
ProjMain / projOther1 / 
projOther2 etc.  I have the latter situation (now).  When I try to do "Using
projOther1;" from 
inside of ProjMain it says that ProjOther doesn't exist.

This whole area seems poorly documented and rather messy.  Lots of chatter
on Google about how 
difficult it is to move a project and so forth.

This is the kind of stuff I hate to even get involved in.  I am trying to
get work done but get 
sucked off into areas where it certainly looks like I could easily wreak
havoc on working code.

John W. Colby
www.ColbyConsulting.com


Gustav Brock wrote:
> Hi John
> 
> In addition to the comments from Charlotte:
> 
> Also, you can either add in your project
> 
> Using ProjectOther;
> 
> or state this explicitly
> 
> ProjectOther.MyFormName someName = new ProjectOther.MyFormName();
> someName.Show();
> 
> /gustav
> 
>>>> jwcolby at colbyconsulting.com 18-11-2009 18:57 >>>
> OK, this immediately causes issues referencing objects in another project.
For example I have a 
> "main" project, and a "CSVRepair" project.  The Main project form opens
when I run the project but I 
> then need to be able to open a form in the other project where I gather
information about the file 
> to fix.
> 
> The objects in that other project aren't visible in intellisense.
> 
> "Normal" opening of a form is done with something like
> 
> MyFormName Somename = new MyFormNname();
> SomeName.Show();
> 
> Well... MyFormName is not valid in project main.
> 
> While we are on the subject, what happens if I just need to dimension a
class used in project CSVRepair?
> 
> John W. Colby
> www.ColbyConsulting.com 
> 
> 
> Charlotte Foust wrote:
>> Think of the solution as the application.  The projects within the
solution can be shared with other applications.  We use the projects
primarily to group parts of our apps, like UI, Reports, Data, Configuration,
Security, etc., but it really is up to the architect of the app.
>>
>> Charlotte Foust 
> 
> 
> _______________________________________________
> dba-VB mailing list
> dba-VB at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-vb
> http://www.databaseadvisors.com
> 
> 
_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com


__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4618 (20091118) __________

The message was checked by ESET NOD32 Antivirus.

http://www.esetnod32.ru


 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4618 (20091118) __________

The message was checked by ESET NOD32 Antivirus.

http://www.esetnod32.ru
 




More information about the dba-VB mailing list