C # project (.CSProj) related to files with flat directory structure

I have a C # class library project that includes several external files as β€œlinks”.

In the project file, it looks like:

<None include="MyFile.txt"> <link>MyFile.txt</link> <CopyToOutputDirectory>CopyIfNewer</CopyToOutputDirectory> </None> 

This works great:

  • I see files in Visual Studio.
  • They are linked directly, and are not copied to my project.
  • Files are copied to the output directory.

But now I want to rebuild my project in a directory. In the above example, I replaced Myfile.txt MyDir \ MyFile.txt in the link tag.

Now I end up with the MyDir directory in the output directory that I don't want. I would like to have the file in a directory in Solution Explorer, but not in the output folder.

I cannot find a way to do this - is it possible?

+4
source share
2 answers

Solution packages are what you want, I think.

+1
source

this design behavior avoids duplicate file conflicts and other similar problems.

You must arrange the project files using visual studio Solution folder instead of directories

http://msdn.microsoft.com/en-us/library/sx2027y2.aspx

+1
source

Source: https://habr.com/ru/post/1390328/


All Articles