简体   繁体   English

与包含许多单元测试项目的示例文件共享一个文件夹

[英]Share one folder with sample files for many unit test projects

I'm trying to create 1 folder with sample files, for example .bmp files. 我正在尝试使用示例文件创建1个文件夹,例如.bmp文件。 Now I have 3 unit test projects. 现在我有3个单元测试项目。 How to move files from this folder to output directory of each unit testing project? 如何将文件从此文件夹移动到每个单元测试项目的输出目录?

I was searching for answer on the web, but looks like this simple problem have very complicated solutions... 我在网上搜索答案,但看起来这个简单的问题有非常复杂的解决方案......

I guess the easiest way to do this would be to put your files into a portable class library and reference them in the projects you need the files in. The assets will then be copied to the respective output folders. 我想最简单的方法是将文件放入可移植的类库中,并在需要文件的项目中引用它们。然后将资产复制到相应的输出文件夹中。

This will only work in Visual Studio 2012 Professional, Premium, or Ultimate, not the Express Version. 这仅适用于Visual Studio 2012 Professional,Premium或Ultimate,而不适用于Express版本。 Also your project has to be on .NET 4.5. 您的项目也必须在.NET 4.5上。

See Portable Class Libraries on MSDN for further reference. 有关进一步的参考,请参阅MSDN上的可移植类库

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM