繁体   English   中英

C#WPF将DLL和.exe合并到一个文件

[英]C# WPF Merge DLL and .exe to one file

将DLL和.exe合并到一个文件中时出现问题。

我曾尝试使用教程,但不知道应在哪里添加以下代码:

<Target Name="AfterResolveReferences">
  <ItemGroup>
    <EmbeddedResource Include="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.Extension)' == '.dll'">
      <LogicalName>%(ReferenceCopyLocalPaths.DestinationSubDirectory)%(ReferenceCopyLocalPaths.Filename)%(ReferenceCopyLocalPaths.Extension)</LogicalName>
    </EmbeddedResource>
  </ItemGroup>
</Target>

谢谢!

在大多数(全部?)C#项目文件( .csproj )中,底部附近都有一行:

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

博客文章说您应该在项目文件的该行之后插入新行。 您将需要使用文本编辑器来执行此操作:无法使用Visual Studio UI更改项目文件的该部分。

暂无
暂无

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

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