开发者

Name of embedded resource

In C#, the default behaviour of embedded resource name is like this:

<default namespace.><extende开发者_StackOverflowd namespace.><filename>

Without changing the default namespace of the project, can I control the name of embedded resource?


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.

Here is the relevant XML snippet:

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


If you're still having a bit of a hard time after trying @JustinDearing's answer, try this:

  1. set the verbosity of MSBuild to 'Detailed' in your V.S. options:

    Name of embedded resource

  2. Build your project

  3. Copy the output from the 'Build' log pane, paste into a text editor, search for 'manifest'

    Name of embedded resource

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜