有没有一种方法来合并PDB文件ilmerge? [英] Is there a way to merge pdb files with ilmerge?

查看:195
本文介绍了有没有一种方法来合并PDB文件ilmerge?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关我们使用ilmerge把我们所有的应用程序集到一个文件中,以便用户需要处理只是一个文件的各种原因。不幸的是,似乎没有办法与组件合并.pdb文件。任何人都知道一个方法来解决呢?

For various reasons we use ilmerge to put all of our application assemblies into one file so the user needs to handle just one file. Unfortunately it seems that there is no way to merge the .pdb files with the assemblies. Anyone knows a way to work around that?

推荐答案

好吧,我想通这一个,但过了好一会儿。

Ok, I figured this one out, though it took a while.

这篇文章有/ NDEBUG正好反了。

从发行说明附带ILMerge(ILMerge.doc,重点煤矿):

From the release notes that come with ILMerge (ILMerge.doc, emphasis mine):

2.8 debuginfo软公布尔debuginfo软{获得;组; }   当设置为true,   ILMerge创造了一个.pdb文件   输出装配和并入的任何   发现输入组件.pdb文件。   如果你的不可以想创建一个.pdb文件   为输出组件,任一组   该属性设置为false,否则指定   在命令/ NDEBUG选项   。行的默认值:true命令行   选项​​:/ NDEBUG

2.8 DebugInfo public bool DebugInfo { get; set; } When this is set to true, ILMerge creates a .pdb file for the output assembly and merges into it any .pdb files found for input assemblies. If you do not want a .pdb file created for the output assembly, either set this property to false or else specify the /ndebug option at the command line. Default: true Command line option: /ndebug

解决方案是专为不可以有该标志在命令行上。 ILMerge将默认合并pdb文件。确保所有的源组件的PDB文件都在同一个目录下,沿侧面及其关联的dll文件,从而使ILMerge可以找到它们。 (我们使用的是项目引用,并有一个ILMerge项目,该项目利用了这项要求。)

The solution is specifically to not have that flag on your command line. ILMerge will merge pdb files by default. Make sure that all of the pdb files of your source assemblies are in the same directory, along side their associated dlls, so that ILMerge can find them. (We are using project references and have one ILMerge project, which takes care of this requirement.)

下面是从我ILMerge的csproj文件中的相关部分。

Here is the relevant section from my ILMerge csproj file.

 <Target Name="AfterBuild">
    <CreateItem Include="@(ReferencePath)" Condition="'%(CopyLocal)'=='true'">
      <Output TaskParameter="Include" ItemName="IlmergeAssemblies" />
    </CreateItem>
    <Exec Command="&quot;..\..\Libraries\Ilmerge.exe&quot; /copyattrs /allowMultiple /out:&quot;@(MainAssembly)&quot; &quot;@(IntermediateAssembly)&quot; @(IlmergeAssemblies->'&quot;%(FullPath)&quot;', ' ')" />
    <Delete Files="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')" />
  </Target>

有关完整,我使用的是最新版本的ilmerge.exe:版本2.10.219.0,随着2010/2/19上午9点49分最后修改日期

For completeness, I am using the latest version of ilmerge.exe: Version 2.10.219.0, with a last modified date of 2/19/2010 9:49 AM

这篇关于有没有一种方法来合并PDB文件ilmerge?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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