How get the default namespace of project csproj (VS 2008)
You can't.
The default namespace isn't stored anywhere within the assembly. It's just a project setting of Visual Studio.
What I tend to do is use the name of the assembly: Assembly.GetName().Name
. The problem with this is that it only works if the assembly name has not been changed.
For your specific issue, you can use assembly.GetManifestResourceNames()
and do some tests over those names, e.g.:
string name = assembly.GetManifestResourceNames().Single(p => p.EndsWith(".SyntaxModes.Xml"))
Not 100% sure it's what you're looking for but you can get the namespace using :
this.GetType().Namespace