嵌入式资源名称嵌入式、名称、资源

2023-09-03 06:09:33 作者:素面白裳红酥手

在嵌入式resorce名称C#默认行为是这样的

In c# default behaviour of embedded resorce name is like this

<default namespace.><extended namespace.><filename>

在不改变项目的defaultName中的空间,我可以控制的嵌入式资源的名称?

Without changing the defaultname space of project can i control the name of embedded resource?

推荐答案

要做到这一点的方法是相当简单的,但你必须编辑Visual Studio项目在文本编辑器(的csproj或vbproj)文件。请参见这个MSDN博客帖子。

The way to do this is quite simple, but you will have to edit the Visual Studio Project (csproj or vbproj) file in a text editor. See this msdn blog post.

下面是相关的XML片断:

Here is the relevant xml snippet:

<ItemGroup>
  <EmbeddedResource Include="bar.resx">
      <LogicalName>notfoo.bar.resources</LogicalName>
  </EmbeddedResource>
</ItemGroup>