0

I'm working on a C# project in Visual Studio 2010 where I have the following folder structure:

ProjectName
    ProjectName.sln
    AssemblyName
        AssemblyName.csproj
        src
            App.xaml
            App.xaml.cs
            MainWindow.xaml
            MainWindow.xaml.cs
            [additional code files and folders with code]

This results in all my code files having this namespace:

namespace AssemblyName.src

I would like to omit the src folder from the namespace resulting in this namespace:

namespace AssemblyName

Is this possible?

I like having all the source files separated from the metadata for the project. But I would like the "src" folder to be hidden from the namespace (for cosmetic reasons)

FrederikNS
  • 5,562
  • 2
  • 22
  • 36

2 Answers2

1

Use Resharper: Where Does Visual Studio Remember Which Folders are "Namespace Providers"?

Community
  • 1
  • 1
Jim Bolla
  • 8,265
  • 36
  • 54
1

The default templates will add the folder path to your file.

You are welcome to change it when you add new types, however. Just remove the ".src" from the namespace that is generated, and when you compile, it will have the namespace you specify.

Reed Copsey
  • 554,122
  • 78
  • 1,158
  • 1,373