2010-12-08 24 views
7

ILMerge +ローカライズされたリソースアセンブリ

  • \ binに\デバッグ\ TEST.EXE
  • \ビン\デバッグ\は\ test.resources.dll
  • NL-BE \ binに\デバッグ\ FR-FR \ test.resources.dll

それは1つのフォーム(Form1.csの)との簡単なテストプロジェクトです 、何も特別なことはありません。 私の目標は、動作中のリソースマネージャーを使用して単一のアセンブリアプリケーションを作成することです(これについては、ILMerge and localized resource assembliesSingle-assembly multi-language Windows Forms deployment (ILMerge and satellite assemblies/localization) - possible?を読んでいます)。

ilmerge /log:test.txt /target:winexe /copyattrs /allowdup /out:test_merged.exe 
"C:\projectdir\bin\Debug\test.exe" "C:\projectdir\bin\Debug\fr-FR\test.resources.dll" 
"C:\projectdir\bin\Debug\nl-BE\test.resources.dll" 

私はリフレクターでマージされたアセンブリの内容を確認した場合、私はリソースツリーノードの下に以下を参照してください:プロジェクトをコンパイルした後、私は次のコマンドラインパラメータでILMergeを実行

  • test.Form1.fr-FR.resources
  • test.Form1.fr-FR.resources
  • test.Form1.resources
  • 代わりに、私は2回、FR-FRリソースを持っているFR-FRとNL-BEリソースの
  • test.Properties.Resources.resources

。これは、リソースdllの名前が同じであるためですか?その結果、実行時にfr-FRリソースしか取得できなくなります。

アイデア?

更新(ファイルの内容をログに記録): :

ILMerge version 2.10.526.0 
Copyright (C) Microsoft Corporation 2004-2006. All rights reserved. 
ILMerge /log:loc_test.txt /target:winexe /copyattrs /allowdup /out:loc_test_merged.exe c:\Users\<user>\Documents\Visual Studio 2008\Projects\loc_test\loc_test\bin\Debug\loc_test.exe C:\Users\<user>\Documents\Visual Studio 2008\Projects\loc_test\loc_test\bin\Debug\fr-FR\loc_test.resources.dll C:\Users\<user>\Documents\Visual Studio 2008\Projects\loc_test\loc_test\bin\Debug\nl-BE\loc_test.resources.dll 
Set platform to 'v2', using directory 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\..\v2.0.50727' for mscorlib.dll 
Running on Microsoft (R) .NET Framework v2.0.50727 
mscorlib.dll version = 2.0.0.0 
The list of input assemblies is: 
    c:\Users\<user>\Documents\Visual Studio 2008\Projects\loc_test\loc_test\bin\Debug\loc_test.exe 
    C:\Users\<user>\Documents\Visual Studio 2008\Projects\loc_test\loc_test\bin\Debug\fr-FR\loc_test.resources.dll 
    C:\Users\<user>\Documents\Visual Studio 2008\Projects\loc_test\loc_test\bin\Debug\nl-BE\loc_test.resources.dll 
Trying to read assembly from the file 'c:\Users\<user>\Documents\Visual Studio 2008\Projects\loc_test\loc_test\bin\Debug\loc_test.exe'. 
    Successfully read in assembly. 
    There were no errors reported in loc_test's metadata. 
Trying to read assembly from the file 'C:\Users\<user>\Documents\Visual Studio 2008\Projects\loc_test\loc_test\bin\Debug\fr-FR\loc_test.resources.dll'. 
Can not find PDB file. Debug info will not be available for assembly 'C:\Users\<user>\Documents\Visual Studio 2008\Projects\loc_test\loc_test\bin\Debug\fr-FR\loc_test.resources.dll'. 
    Successfully read in assembly. 
    There were no errors reported in loc_test.resources's metadata. 
Trying to read assembly from the file 'C:\Users\<user>\Documents\Visual Studio 2008\Projects\loc_test\loc_test\bin\Debug\nl-BE\loc_test.resources.dll'. 
Can not find PDB file. Debug info will not be available for assembly 'C:\Users\<user>\Documents\Visual Studio 2008\Projects\loc_test\loc_test\bin\Debug\nl-BE\loc_test.resources.dll'. 
    Successfully read in assembly. 
    There were no errors reported in loc_test.resources's metadata. 
Checking to see that all of the input assemblies have a compatible PeKind. 
    loc_test.PeKind = ILonly 
    loc_test.resources.PeKind = ILonly 
    loc_test.resources.PeKind = ILonly 
All input assemblies have a compatible PeKind value. 
Merging assembly 'loc_test' into target assembly. 
Merging assembly 'loc_test.resources' into target assembly. 
Merging assembly 'loc_test.resources' into target assembly. 
Merging assembly-level attributes from assembly 'loc_test' into target assembly. 
Copying 2 Win32 Resources from assembly 'loc_test' into target assembly. 
Transferring entry point 'loc_test.Program.Main' from assembly 'loc_test' to assembly 'loc_test_merged'. 
    There were no errors reported in the target assembly's metadata. 
ILMerge: Writing target assembly 'loc_test_merged.exe'. 
AssemblyResolver: Assembly 'System' is referencing assembly 'System.Configuration'. 
    AssemblyResolver: Attempting referencing assembly's directory. 
Can not find PDB file. Debug info will not be available for assembly 'System.Configuration'. 
Resolved assembly reference 'System.Configuration' to 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Configuration.dll'. (Used referencing Module's directory.) 
Location for referenced assembly 'System.Windows.Forms' is 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll' 
    There were no errors reported in System.Windows.Forms's metadata. 
Location for referenced assembly 'System' is 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll' 
    There were no errors reported in System's metadata. 
Location for referenced assembly 'mscorlib' is 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll' 
    There were no errors reported in mscorlib's metadata. 
Location for referenced assembly 'System.Drawing' is 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll' 
    There were no errors reported in System.Drawing's metadata. 
ILMerge: Done. 

(注バイナリが「loc_」が付いている、私はわかりやすくするために私の以前の投稿でそれらを左)更新:プロジェクトコード付きzipファイルhttp://www.filedropper.com/loctest

更新:それを信じるかどうかはわかりませんが、ILMergeを2ステップで実行すると機能します。

ilmerge /log:loc_test.txt /target:winexe /copyattrs /allowdup /out:loc_test_merged.exe "c:\Users\<user>\Documents\Visual Studio 2008\Projects\loc_test\loc_test\bin\Debug\loc_test.exe" "C:\Users\<user>\Documents\Visual Studio 2008\Projects\loc_test\loc_test\bin\Debug\fr-FR\loc_test.resources.dll" 

ilmerge /log:loc_test.txt /target:winexe /copyattrs /allowdup /out:loc_test_merged_2.exe loc_test_merged.exe "C:\Users\<user>\Documents\Visual Studio 2008\Projects\loc_test\loc_test\bin\Debug\nl-BE\loc_test.resources.dll" 

これにはどのような原因が考えられますか?私はILMergeは2つの段階で正しくアセンブリを統合した理由についての詳細を知っていませんが

Thxを、 Janiek

+0

が見えます/ 1952638/single-assembly-multi-language-winforms-deployment-ilmerge-and-satellite-assembl –

+0

私はその質問を読んだ。これは、必要なリソースが最初にILMergeによって正しく組み込まれている場合にのみ、そのジョブをうまく実行できるComponentResourceManagerクラスについて詳しく説明しています。 –

+0

ログファイルtest.txtの出力を指定してください –

答えて

4

、これは現時点で唯一の解決策であるように思われます。質問の最後の編集をチェックして、私がこれをどうやって行ったかを見てください。あなたはhttp://stackoverflow.com/questionsに溶液中で概説希望を介してジャンプする必要があると思いますように、私はまだそれが1つのステップで行うことができない理由しかし興味

...

関連する問題