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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. namespaces in VS 2005

namespaces in VS 2005

Scheduled Pinned Locked Moved C#
visual-studiocomdesigncareer
3 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.
  • C Offline
    C Offline
    Christopher Duncan
    wrote on last edited by
    #1

    I'm sure I'm overlooking something embarrasingly obvious here, but... In my VS 2003 projects, each file was wrapped in a common namespace. I typically derive a base page class from the system ui page, and then derive all my pages from it so that I can use it for common page code. No problemo. However, I just discovered that VS 2005 doesn't wrap namespace code around all the pages. Consequently, when deriving my pages from my base page class, the compiler complains that it can't find a class or namespace matching the name the base page class I've created. It was my understanding that everything was a member of the implicit global namespace, so I don't know why the class name isn't recognized. I put it in it's own .cs file & added to the project. Anyway, I'm sure it's some glaring little thing I'm overlooking, but if someone could set me straight I'd be most grateful. Thanks!

    Author of The Career Programmer and Unite the Tribes www.PracticalStrategyConsulting.com

    J 1 Reply Last reply
    0
    • C Christopher Duncan

      I'm sure I'm overlooking something embarrasingly obvious here, but... In my VS 2003 projects, each file was wrapped in a common namespace. I typically derive a base page class from the system ui page, and then derive all my pages from it so that I can use it for common page code. No problemo. However, I just discovered that VS 2005 doesn't wrap namespace code around all the pages. Consequently, when deriving my pages from my base page class, the compiler complains that it can't find a class or namespace matching the name the base page class I've created. It was my understanding that everything was a member of the implicit global namespace, so I don't know why the class name isn't recognized. I put it in it's own .cs file & added to the project. Anyway, I'm sure it's some glaring little thing I'm overlooking, but if someone could set me straight I'd be most grateful. Thanks!

      Author of The Career Programmer and Unite the Tribes www.PracticalStrategyConsulting.com

      J Offline
      J Offline
      Jim Conigliaro
      wrote on last edited by
      #2

      The "Web Site" project in VS05 is a fundamental shift in architecture from the web projects in VS03. The web site projects are operate less like applications and more like content managed web sites. Web pages get indivually compiled into their own dlls by default and as such, don't belong to a namespace. You could manually add namespaces and configure the project to compile to a single dll, however, I would recommend that you install the "Web Application" project, which didn't ship with VS05 but is available for download from: http://msdn2.microsoft.com/en-us/asp.net/aa336618.aspx[^] The Web Application project is more consistent with the VS03 web projects and is easier to manage as a complex application.

      Jim Conigliaro jconigliaro@ieee.org
      http://www.jimconigliaro.com

      C 1 Reply Last reply
      0
      • J Jim Conigliaro

        The "Web Site" project in VS05 is a fundamental shift in architecture from the web projects in VS03. The web site projects are operate less like applications and more like content managed web sites. Web pages get indivually compiled into their own dlls by default and as such, don't belong to a namespace. You could manually add namespaces and configure the project to compile to a single dll, however, I would recommend that you install the "Web Application" project, which didn't ship with VS05 but is available for download from: http://msdn2.microsoft.com/en-us/asp.net/aa336618.aspx[^] The Web Application project is more consistent with the VS03 web projects and is easier to manage as a complex application.

        Jim Conigliaro jconigliaro@ieee.org
        http://www.jimconigliaro.com

        C Offline
        C Offline
        Christopher Duncan
        wrote on last edited by
        #3

        Thanks, Jim. That's useful info about web sites versus applications. As it turns out, moving the .cs file to the App_Code folder makes it globally accessible. Not particularly intuitive, but kinda nice from a file management perspective.

        Author of The Career Programmer and Unite the Tribes www.PracticalStrategyConsulting.com

        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