Read a file compile-time in C#

前端 未结 6 1312
攒了一身酷
攒了一身酷 2021-01-05 13:37

I am writing some unit tests in which I need a fake xml file. I can create that file and require it to be deployed with the unit tests, but experience shows that at my offic

6条回答
  •  萌比男神i
    2021-01-05 14:39

    I usually add such test files directly into the unit test C# project and set them as "Content" and "Copy if newer" to be copied to the bin directory during the compilation.

提交回复
热议问题