CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2011
    Posts
    6

    Update namespace properties at runtime/compiletime

    Hi all,

    Trying to work through a problem and haven't been able to find any help on the web, so hoping that one of the gurus here may have an idea.

    I'm working on an application that has a couple of default naming conventions for new projects (C# code libraries) and namespaces. New projects (extensions in this case) should be named as:

    Project = Ext.MyProjectName
    Assembly Name = Something.Something.Something.Extension.MyProjectName
    Default Namespace = Something.Something.Extension.MyProjectName

    Sorry for all the "Something"s but they're only relevant to this particular project. I'm looking for a way to either fix up all the properties as soon as a new project is created, or a macro/custom build tool that will run through and make the updates at compile time.

    It's easy enough in the Visual Studio templates to set the default namespace to Something.Something.$safeprojectname$ but that leaves it as Ext.MyProjectName rather than the expanded Extension.MyProjectName. And there seems to be an acknowledged bug in VS2008 that won't let the Assembly Name be formatted in the same way, it simply gets replaced by $safeprojectname$.

    Any takers??

  2. #2
    Join Date
    Feb 2011
    Posts
    6

    Re: Update namespace properties at runtime/compiletime

    A few more details that I missed in the first post:

    Using Visual Studio 2008
    .NET 3.5
    Working on a big solution file with many child C# Code Library projects

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured