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

G

Genboy

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.
 
C

Chris R. Timmons

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.
 
G

Genboy

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
 
J

James Curran

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 said:
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.
 
G

Genboy

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
 
G

Genboy

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top