Is there such a thing as a “content/data only project” in visual studio

前端 未结 6 1881
无人共我
无人共我 2021-02-06 23:21

I have a bunch of ancillary XML and XSLT files that I want to edit and manage in visual studio.

The files do not logically belong under any code project in my solution

6条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-07 00:10

    In my situation, I needed to have a set of configuration files that would be common to many projects. To simply achieve this, I performed the following steps:

    1. Create a Class Library project named "Configuration"
    2. Delete all *.cs files from Configuration project
    3. Put configuration files in a "Configuration" folder in the Configuration project
    4. Copy configuration files to required projects in the post-build event. In Configuration project's Properties > Build Events > Post-build event:
    xcopy "$(TargetDir)Configuration\*" "$(SolutionDir)TARGET_PROJECT\$(OutDir)" /i /v /q /s /y
    

    In the above, replace TARGET_PROJECT with your actual project

    This will copy all the files in the Configurations folder to the output directory of the project that needs the configuration files (eg. MyProject/bin/Debug, etc).

提交回复
热议问题