将.xml构建为嵌入式资源时调用哪个Target [英] Which Target is called when building .xml as embedded resource

查看:60
本文介绍了将.xml构建为嵌入式资源时调用哪个Target的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有这种情况:

MyFile.cs ;       [编译]
+ --- MyFile.xml         [EmbeddedResource]
+ --- MyFile2.xml        [EmbeddedResource] [LogicalName = MyFile2]

两个.xml文件是DependentUpon .cs文件.由于无法将多个嵌入式资源添加到装配中,因此这会在构建过程中引起问题.我使用< LogicalName>解决了此问题.csproj中的元数据,例如:

Hi all,

I've got this situation:

MyFile.cs                  [Compile]
+---MyFile.xml          [EmbeddedResource]
+---MyFile2.xml         [EmbeddedResource] [LogicalName=MyFile2]

Two .xml files are DependentUpon .cs file. This cause a problem during building, since is not possibile to add more than one embedded resource to an assembly. I solved this using <LogicalName> metadata in .csproj, like this:

<EmbeddedResource Include="MyFile2.xml">







 <DependentUpon>MyFile.cs</DependentUpon>







 <LogicalName>MyFile2</LogicalName>







</EmbeddedResource>







推荐答案

您好,Matteo

这不是一个确切的答案,但请访问www.msbuildexplorer.com.您可以加载csproj文件,查看所有可用的目标以及它们按什么顺序运行.这可能会对您有所帮助.

问候

Mike
Hi Matteo

It's not exactly an answer, but take a look at www.msbuildexplorer.com. You can load your csproj file and look at all the targets that are available and what order they run in. That might help you.

Regards

Mike


这篇关于将.xml构建为嵌入式资源时调用哪个Target的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆