By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,414 Members | 2,919 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,414 IT Pros & Developers. It's quick & easy.

Command Line Compiler, CS0116: A namespace does not directly contain members such as fields or methods

P: n/a
My "VIS" Website, which is a C# site created in VS.NET, Framework 1.1,
is no longer compiling for me via the command line.

As I have done 600 times in the last year and a half, I can compile to
VIS.DLL via Visual Studio, with no problems:

------ Rebuild All started: Project: VIS,
Configuration: Debug .NET ------
Preparing resources...
Updating references...
Performing main compilation...

Build complete -- 0 errors, 0 warnings
Building satellite assemblies...
---------------------- Done ----------------------
Rebuild All: 1 succeeded, 0 failed, 0 skipped
However (as I have done 200 times in the last year and a half!!) I am
suddenly unable to compile from the command line:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>

Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.

Admin\_vti_cnf\AdminMenu.aspx.cs(1,1): error CS0116: A namespace does
not directly contain members such as fields or methods
Admin\_vti_cnf\dsRatesByLocation.cs(1,1): error CS0116: A namespace
does not directly contain members such as fields or methods
Admin\_vti_cnf\dsRatesByMOU.cs(1,1): error CS0116: A namespace does not
directly contain members such as fields or methods
Admin\_vti_cnf\dsRatesByPXPID.cs(1,1): error CS0116: A namespace does
not directly contain members such as fields or methods
............. Yadda yadda yadda [every single file is listed,
same error, same "line, char" of (1,1) .......
Volunteer\_vti_cnf\xt_Status.aspx.cs(1,1): error CS0116: A namespace
does not directly contain members such as fields or methods
Volunteer\_vti_cnf\xt_Volunteer.aspx.cs(1,1): error CS0116: A namespace
does not directly contain members such as fields or methods
_vti_cnf\AssemblyInfo.cs(1,1): error CS0116: A namespace does not
directly contain members such as fields or methods
_vti_cnf\authenticate.aspx.cs(1,1): error CS0116: A namespace does not
directly contain members such as fields or methods
_vti_cnf\authentication_unused.cs(1,1): error CS0116: A namespace does
not directly contain members such as fields or methods
_vti_cnf\default.aspx.cs(1,1): error CS0116: A namespace does not
directly contain members such as fields or methods
_vti_cnf\Global.asax.cs(1,1): error CS0116: A namespace does not
directly contain members such as fields or methods
_vti_cnf\indexOSA.aspx.cs(1,1): error CS0116: A namespace does not
directly contain members such as fields or methods
_vti_cnf\indexVol.aspx.cs(1,1): error CS0116: A namespace does not
directly contain members such as fields or methods
_vti_cnf\LdapAuthentication.cs(1,1): error CS0116: A namespace does not
directly contain members such as fields or methods
_vti_cnf\login.aspx.cs(1,1): error CS0116: A namespace does not
directly contain members such as fields or methods
_vti_cnf\logon.aspx.cs(1,1): error CS0116: A namespace does not
directly contain members such as fields or methods
_vti_cnf\VISAuth.aspx.cs(1,1): error CS0116: A namespace does not
directly contain members such as fields or methods
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<

using this command:
csc /t:library /out:bin/VIS.dll /recurse:*.cs /nowarn:183 /lib:bin >
buildlog.txt

This is the same as I have always used.

Note that, obviously, none of my cs files suddenly have fields,
methods, or variables declared right below the namespace level! This
error must have something to do with the configuration of the
machine(s) on which I am trying to compile it. [[Right??]]. The "error"
shows up in the output of csc for every single file in the project.

Thanks for any help you can give.

Nov 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Genboy,

Why are you trying to compile the code in the "_vti_cnf" folder?
Eliminate that folder from your command-line build process and the
project should compile w/o problems.
Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Nov 17 '05 #2

P: n/a
Thanks, Chris; I am not in the office to try this til Monday (although
I may make a special trip!). I actually don't know what the heck that
folder does anyway, nor how it suddenly cropped up. I'll do a bit of
research on that, and report back my results soon as I can. Thanks
again. -- Roy

Nov 17 '05 #3

P: n/a
As far as I can see, you recently started using FrontPage with this
site. FrontPage uses the _vti_cnf directories to hold the site publishing
infomation. Basically, within each folder in the site, FP creates a
sub-folder with "shadow" copies of each file in the parent folder --- files
with the same names but completely different contents as the files in the
parent.

So, when you say " /recurse:*.cs " you're telling it to try to compile
all the files, the good one *and* FP's fake ones. You will probably have to
more explicitly state with folders to compile.

--
--
Truth,
James Curran
[erstwhile VC++ MVP]

Home: www.noveltheory.com Work: www.njtheater.com
Blog: www.honestillusion.com Day Job: www.partsearch.com

"Genboy" <ge*****@yahoo.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
My "VIS" Website, which is a C# site created in VS.NET, Framework 1.1,
is no longer compiling for me via the command line.

As I have done 600 times in the last year and a half, I can compile to
VIS.DLL via Visual Studio, with no problems:

------ Rebuild All started: Project: VIS,
Configuration: Debug .NET ------
Preparing resources...
Updating references...
Performing main compilation...

Build complete -- 0 errors, 0 warnings
Building satellite assemblies...
---------------------- Done ----------------------
Rebuild All: 1 succeeded, 0 failed, 0 skipped
However (as I have done 200 times in the last year and a half!!) I am
suddenly unable to compile from the command line:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>

Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.

Admin\_vti_cnf\AdminMenu.aspx.cs(1,1): error CS0116: A namespace does
not directly contain members such as fields or methods
Admin\_vti_cnf\dsRatesByLocation.cs(1,1): error CS0116: A namespace
does not directly contain members such as fields or methods
Admin\_vti_cnf\dsRatesByMOU.cs(1,1): error CS0116: A namespace does not
directly contain members such as fields or methods
Admin\_vti_cnf\dsRatesByPXPID.cs(1,1): error CS0116: A namespace does
not directly contain members such as fields or methods
............. Yadda yadda yadda [every single file is listed,
same error, same "line, char" of (1,1) .......
Volunteer\_vti_cnf\xt_Status.aspx.cs(1,1): error CS0116: A namespace
does not directly contain members such as fields or methods
Volunteer\_vti_cnf\xt_Volunteer.aspx.cs(1,1): error CS0116: A namespace
does not directly contain members such as fields or methods
_vti_cnf\AssemblyInfo.cs(1,1): error CS0116: A namespace does not
directly contain members such as fields or methods
_vti_cnf\authenticate.aspx.cs(1,1): error CS0116: A namespace does not
directly contain members such as fields or methods
_vti_cnf\authentication_unused.cs(1,1): error CS0116: A namespace does
not directly contain members such as fields or methods
_vti_cnf\default.aspx.cs(1,1): error CS0116: A namespace does not
directly contain members such as fields or methods
_vti_cnf\Global.asax.cs(1,1): error CS0116: A namespace does not
directly contain members such as fields or methods
_vti_cnf\indexOSA.aspx.cs(1,1): error CS0116: A namespace does not
directly contain members such as fields or methods
_vti_cnf\indexVol.aspx.cs(1,1): error CS0116: A namespace does not
directly contain members such as fields or methods
_vti_cnf\LdapAuthentication.cs(1,1): error CS0116: A namespace does not
directly contain members such as fields or methods
_vti_cnf\login.aspx.cs(1,1): error CS0116: A namespace does not
directly contain members such as fields or methods
_vti_cnf\logon.aspx.cs(1,1): error CS0116: A namespace does not
directly contain members such as fields or methods
_vti_cnf\VISAuth.aspx.cs(1,1): error CS0116: A namespace does not
directly contain members such as fields or methods
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<

using this command:
csc /t:library /out:bin/VIS.dll /recurse:*.cs /nowarn:183 /lib:bin >
buildlog.txt

This is the same as I have always used.

Note that, obviously, none of my cs files suddenly have fields,
methods, or variables declared right below the namespace level! This
error must have something to do with the configuration of the
machine(s) on which I am trying to compile it. [[Right??]]. The "error"
shows up in the output of csc for every single file in the project.

Thanks for any help you can give.

Nov 17 '05 #4

P: n/a
Well, I was thinking of ditching VS for FrontPage. But Intellisense
doesn't seem to be working!

;-)

Maybe someone tried changing the access type from File Share to FP and
back. Who knows.

Thanks for the explanation though --

RS

Nov 17 '05 #5

P: n/a
That was indeed the problem. Some well-meaning dunderhead trying to fix
a VSS problem re-installed FrontPage Server Extensions on the dev
server. It created a _vti_cnf folder, with copies of source files,
under every subdir in my project. When I tried to compile (recursively
nabbing all C# files), all the _vti folders and code got added, so
every namespace showed up twice.

It became clear along the way that CS0116 is a fairly generic error
message.

Thanks for the help, I owe the solution to Mr. Timmons and those of you
who replied.

Nov 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.