0

I'd like to add files to a web csproj that are located under its directory, but in a different directory structure than the physical one. Example physical directory structure:

  • MyProject.csproj
    • Assets
      • Settings.config

Now my project needs the following structure when I publish the project (i.e. on the server when deployed) and would be nice if this structure would be visible from Visual Studio too:

  • MyProject.csproj
    • Config
      • Settings.config

Notice that Settings.config isn't in the Assets but in the Config folder.

I don't want to copy the files over, I can't move them and I can't change where these files are loaded from.

Is it possible for such files to be located in the Assets folder while

  • from VS they appear to be in the Config folder,
  • and when the project is published they are copied to the Config folder.

The latter one is possible with post-build tasks I think and I believe I can implement it. However I'd like to have the whole development experience, including the folder structure in VS, to show the file being under Config. Is this possible?

I'm looking for something like solution folders, but for projects. Adding files as links would work great, but since the files are in the physical folder of the project I get the error "Cannot add a link to a file that is inside the project tree".

Piedone
  • 2,693
  • 2
  • 24
  • 43
  • 1
    Not to diminish the question itself or the technical aspects of it...but why? – Wim Ombelets Sep 11 '14 at 13:48
  • A framework I'm using needs a particular folder structure, but in my case several files (there are many such "Settings.config" files) come from an external repository. Due to other technical constraints I have to place these files under the project's folder (thus can't use links) and can't put them into the actual location I need them. – Piedone Sep 11 '14 at 13:51

0 Answers0