first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

ASMX Web Services PROBLEM: Server Error; "Cannot declare a namespace and a type" Error; Strange Compilation Error

Description: "An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately."

Compiler Error Message: "CS0010: Cannot declare a namespace and a type both named" 'foo.bar'...

This error occurs in Web Service projects referencing external assemblies. In my particular case these are Project references. The Solution will compile without errors or warnings. The server seems to throw when the ASMX files are unchanged but the referenced project code changes.

The error goes away when an ASMX file is purposely modified and the solution is recompiled. In my particular case, I have the misfortune of compiling/running these ASMX files on IIS for Windows 2000 Workstation.

mod date: 2005-07-28T16:22:50.000Z