c# - 生成操作 : Content - how do get it to the Executing Assemblies folder instead of just the project folder?

标签 c# visual-studio-2010

我有一个引用 ProjectA 的服务。在 ProjectA 中,我有一系列 XML 文件,它们都有一个 ContentBuild Action 和一个 Copy to Output Direction始终复制

当我编译时,正如预期的那样,我可以转到 ProjectA/bin/debug 文件夹并查看 XML 文件。这很好,但是当我运行引用 ProjectA 的服务时,这些文件不包含在 Service/bin/debug 文件夹中(尽管 ProjectA.dll 在那里)。

我期望 XML 文件也被复制到 Service/bin/debug 文件夹,因为它们被标记为内容。就像现在一样,“内容”标志似乎有点无用,因为执行程序集似乎无法“访问”那些文件,除非将它们也包含在“服务”项目中(我想避免,因为我'将有多个项目引用 ProjectA)。

关于如何处理这个问题有什么建议吗?

最佳答案

如果您在包含所需命令行副本的服务项目上创建预构建事件,您应该没问题。

关于c# - 生成操作 : Content - how do get it to the Executing Assemblies folder instead of just the project folder?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5841887/

相关文章:

c# - 从客户端应用程序上传的 Azure 媒体服务/blob 存储

c# - 网页添加串口

visual-studio - 从 Visual Studio 2008 到 Visual Studio 2010 Express Edition

c++ - 如何使用添加到 MFC Doc/Frame 项目的对话框的初始化列表

mysql - MySql.Data.dll 中发生类型为 'MySql.Data.MySqlClient.MySqlException' 的第一次机会异常

c# - 使用Visual Web Developer 2010 Web窗体的WebHelper程序集错误

c# - "An invalid or incomplete configuration was used while creating a SessionFactory"Web 服务中的 NHibernate

c# - 基于矢量的生成器是创建条形码的最佳方式吗?

c# - 返回 char * 的 C 函数的 PInvoke

c# - .NET 将类解析为错误的 DLL