How to insert a web link?
Csc problems with using statements
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > .Net Development > Csc problems with using statements 7 May 2002 18:36:41

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

Csc problems with using statements

Adam Sills 7 May 2002 18:36:41
 Anyone else noticed that if you create cs files in visual studio, it puts
all of your using statements above the namespace:

using System;
//blah
namespace MyNamespace {}

While trying to use Nant and CSC to compile some of my projects, I start to
get the "Type or Namespace 'foo' does not exist in ..." errors from the
compiler. If I then move the using statements inside the namespace
declaration, it compiles perfectly (both csc and Nant).

Is this a problem with the compiler? Is it just my problem?

Thanks

Adam..

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.deve­lop.com.

Add comment
Adam Senn 7 May 2002 15:54:02 permanent link ]
 Adam

In all of our C# source files, the using statements are outside of the
namespace. We use primarily makefiles [which call csc] along with a few
instances of nant to build our projects and I've never needed to move the
using statements into the namespaces. Perhaps some needed references were
missing on the command line?

- Adam

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.deve­lop.com.

Add comment
Adam Sills 7 May 2002 17:10:55 permanent link ]
 Yeah, everything builds perfectly in VS.NET, and Nant is happy after I move
the using statements (the references are all there, it just doesn't like
where the using statements are).

I've tracked down exactly which using statements this does happen on...It
only ever happens on classes that are "using" a namespace from a referenced
assembly. My "using System" declarations work perfectly. The only time it
complains is when I am using a few certain of my "framework" classes, and
only when the classes doing the using are in a namespace underneath the main
namespace in the assembly...

[greatland.core.data.dll]
class GreatLand.Core.Data­Manager {}

[greatland.business.dll] (refs core)

using GreatLand.Core.Data­;

namespace GreatLand.Business.­Data
{
class AgencyData : DataManager {}
}

Try to compile with csc or NAnt and it says that DataManager cannot be
found. Compile with VS.NET and it works fine. Move the using statement
inside the namespace and it'll compile everywhere...

Very strange. Ideas?

Adam...


-----Original Message-----
From: Adam Senn [mailto:Adam.Senn@BARRSYSTEMS.COM]
Sent: Tuesday, May 07, 2002 8:54 AM
To: DOTNET@DISCUSS.DEVE­LOP.COM
Subject: Re: [DOTNET] Csc problems with using statements


Adam

In all of our C# source files, the using statements are outside of the
namespace. We use primarily makefiles [which call csc] along with a few
instances of nant to build our projects and I've never needed to move the
using statements into the namespaces. Perhaps some needed references were
missing on the command line?

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.deve­lop.com.

Add comment
Brad Wilson 7 May 2002 17:28:18 permanent link ]
 Sills, Adam wrote:
class GreatLand.Core.Data­Manager {}
[...]> using GreatLand.Core.Data­;

If this isn't a typo, then what you really wanted was:

using GreatLand.Core;

There doesn't seem to be a GreatLand.Core.Data­ namespace anywhere.

Brad

--
Read my web log at http://www.quality.­nu/dotnetguy/

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.deve­lop.com.

Add comment
Adam Sills 7 May 2002 18:36:41 permanent link ]
 It was a Typo. That should be:

class GreatLand.Core.Data­.DataManager

And like I said, it compiles perfectly in VS.NET, but not with CSC (until I
move the using statements). The point is relatively moot, I have NAnt
retrieving all the new files from sourcesafe, then I have a script task that
moves the using statements for me, but I'd rather not do that as it could
possibly lead to the wrong code moving around.

Adam..

-----Original Message-----
From: Brad Wilson [mailto:dotnetguy@POBOX.COM]
Sent: Tuesday, May 07, 2002 10:28 AM
To: DOTNET@DISCUSS.DEVE­LOP.COM
Subject: Re: [DOTNET] Csc problems with using statements


Sills, Adam wrote:
class GreatLand.Core.Data­Manager {}
[...]> using GreatLand.Core.Data­;

If this isn't a typo, then what you really wanted was:

using GreatLand.Core;

There doesn't seem to be a GreatLand.Core.Data­ namespace anywhere.

Brad

--
Read my web log at http://www.quality.­nu/dotnetguy/

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.deve­lop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.deve­lop.com.

Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > .Net Development > Csc problems with using statements 7 May 2002 18:36:41

see also:
DBD::Oracle and 64bit libraries
perl / unixODBC and Oracle 9i
How get a special value of an…
пройди тесты:
see also:
THIS IS ONE MAIL THAT BRINGS TEARS TO…
LOVE KNOWS NO BOUNDS-I SACRIFICED…
LIFE TOOK ME A LITTLE FAR AWAY. MY ONLY…

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .