Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. A namespace cannot directly contain members such as fields or methods

A namespace cannot directly contain members such as fields or methods

Scheduled Pinned Locked Moved ASP.NET
helpcsharp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    indian143
    wrote on last edited by
    #1

    Hi All, I am maintaining a Web Application, when I am trying to Publish it I am getting the following error "A namespace cannot directly contain members such as fields or methods" and I am positive that C# won't allow me to have methods directly under a namespace without class. The above error doesn't give me any information, hence I am researching online for help, please if anybody knows about this, can you please help me by a suggestion, a link or a code snippet. It helps me a lot. Thanks in advance.

    Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."

    D 1 Reply Last reply
    0
    • I indian143

      Hi All, I am maintaining a Web Application, when I am trying to Publish it I am getting the following error "A namespace cannot directly contain members such as fields or methods" and I am positive that C# won't allow me to have methods directly under a namespace without class. The above error doesn't give me any information, hence I am researching online for help, please if anybody knows about this, can you please help me by a suggestion, a link or a code snippet. It helps me a lot. Thanks in advance.

      Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."

      D Offline
      D Offline
      deepankarbhatnagar
      wrote on last edited by
      #2

      See this link, here is your answer: [Resolved] A namespace does not directly contain members such as fields or methods - DotNetFunda.com[^]

      hi

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups