February 14th, 2011, 04:33 PM
Update namespace properties at runtime/compiletime
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$.
February 14th, 2011, 04:41 PM
Re: Update namespace properties at runtime/compiletime
A few more details that I missed in the first post:
Using Visual Studio 2008
Working on a big solution file with many child C# Code Library projects
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.