1

誰かがアセンブリをNHibernatev3.0と正常にマージしましたか?

次のコマンドは機能しません(アセンブリについて文句を言います)

    ..\Tools\ILMerge /log:"merge.txt" 
    /lib:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5" 
    /lib:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0" 
out:SharpArchitecture.dll lib\NHibernate.Validator.dll "lib\Fluent NHibernate\NHibernate.dll" 
/keyfile:"SharpArch.Core\SharpArch.snk"

SharePointで実行できるように、3.5フレームワークをターゲットにする必要があります。

これがログです

ILMerge version 2.11.502.0
Copyright (C) Microsoft Corporation 2004-2006. All rights reserved.
ILMerge /log:merge.txt /lib:C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5 /lib:C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0 /out:SharpArchitecture.dll lib\NHibernate.Validator.dll lib\Fluent NHibernate\NHibernate.dll /keyfile:SharpArch.Core\SharpArch.snk 
Set platform to 'v2', using directory 'C:\Windows\Microsoft.NET\Framework64\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:
    lib\NHibernate.Validator.dll
    lib\Fluent NHibernate\NHibernate.dll
Trying to read assembly from the file 'C:\Dev\Dev\2010\Shared Libraries\Third Party\Sharp Architecture\lib\NHibernate.Validator.dll'.
Can not find PDB file. Debug info will not be available for assembly 'lib\NHibernate.Validator.dll'.
    Successfully read in assembly.
    There were no errors reported in NHibernate.Validator's metadata.
Trying to read assembly from the file 'C:\Dev\Dev\2010\Shared Libraries\Third Party\Sharp Architecture\lib\Fluent NHibernate\NHibernate.dll'.
    Successfully read in assembly.
    There were no errors reported in NHibernate's metadata.
Checking to see that all of the input assemblies have a compatible PeKind.
    NHibernate.Validator.PeKind = ILonly
    NHibernate.PeKind = ILonly
All input assemblies have a compatible PeKind value.
AssemblyResolver: Assembly 'NHibernate.Validator' is referencing assembly 'NHibernate'.
    AssemblyResolver: Attempting referencing assembly's directory.
    AssemblyResolver: Did not find assembly in referencing assembly's directory.
    AssemblyResolver: Attempting input directory.
    AssemblyResolver: Did not find assembly in input directory.
    AssemblyResolver: Attempting user-supplied directories.
    AssemblyResolver: Did not find assembly in user-supplied directories.
    AssemblyResolver: Attempting framework directory.
    AssemblyResolver: Did not find assembly in framework directory.
AssemblyResolver: Unable to resolve reference. (It still might be found, e.g., in the GAC.)
AssemblyResolver: Assembly 'NHibernate.Validator' is referencing assembly 'System.Core'.
    AssemblyResolver: Attempting referencing assembly's directory.
    AssemblyResolver: Did not find assembly in referencing assembly's directory.
    AssemblyResolver: Attempting input directory.
    AssemblyResolver: Did not find assembly in input directory.
    AssemblyResolver: Attempting user-supplied directories.
Resolved assembly reference 'System.Core' to 'C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll'. (Used a client-supplied directory.)
Can not find PDB file. Debug info will not be available for assembly 'System.Core'.
AssemblyResolver: Assembly 'NHibernate.Validator' is referencing assembly 'log4net'.
    AssemblyResolver: Attempting referencing assembly's directory.
Can not find PDB file. Debug info will not be available for assembly 'log4net'.
Resolved assembly reference 'log4net' to 'C:\Dev\Dev\2010\Shared Libraries\Third Party\Sharp Architecture\lib\log4net.dll'. (Used referencing Module's directory.)
AssemblyResolver: Assembly 'NHibernate' is referencing assembly 'Iesi.Collections'.
    AssemblyResolver: Attempting referencing assembly's directory.
Resolved assembly reference 'Iesi.Collections' to 'C:\Dev\Dev\2010\Shared Libraries\Third Party\Sharp Architecture\lib\Fluent NHibernate\Iesi.Collections.dll'. (Used referencing Module's directory.)
AssemblyResolver: Assembly 'NHibernate' is referencing assembly 'System.ServiceModel'.
    AssemblyResolver: Attempting referencing assembly's directory.
    AssemblyResolver: Did not find assembly in referencing assembly's directory.
    AssemblyResolver: Attempting input directory.
    AssemblyResolver: Did not find assembly in input directory.
    AssemblyResolver: Attempting user-supplied directories.
Resolved assembly reference 'System.ServiceModel' to 'C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.ServiceModel.dll'. (Used a client-supplied directory.)
Can not find PDB file. Debug info will not be available for assembly 'System.ServiceModel'.
AssemblyResolver: Assembly 'NHibernate' is referencing assembly 'System.Transactions'.
    AssemblyResolver: Attempting referencing assembly's directory.
    AssemblyResolver: Did not find assembly in referencing assembly's directory.
    AssemblyResolver: Attempting input directory.
    AssemblyResolver: Did not find assembly in input directory.
    AssemblyResolver: Attempting user-supplied directories.
    AssemblyResolver: Did not find assembly in user-supplied directories.
    AssemblyResolver: Attempting framework directory.
Can not find PDB file. Debug info will not be available for assembly 'System.Transactions'.
Resolved assembly reference 'System.Transactions' to 'C:\Windows\Microsoft.NET\Framework64\v2.0.50727\..\v2.0.50727\System.Transactions.dll'. (Used framework directory.)
Using assembly 'NHibernate.Validator' for assembly-level attributes for the target assembly.
Merging assembly 'NHibernate.Validator' into target assembly.
Assembly level attribute 'System.Security.AllowPartiallyTrustedCallersAttribute' from assembly 'NHibernate.Validator' being deleted from target assembly
Merging assembly 'NHibernate' into target assembly.
Duplicate type name: modifying name of the type '<>f__AnonymousType0`2' (from assembly 'NHibernate') to 'NHibernate.<>f__AnonymousType0`2'
Duplicate type name: modifying name of the type '<>f__AnonymousType1`2' (from assembly 'NHibernate') to 'NHibernate.<>f__AnonymousType1`2'
Duplicate type name: modifying name of the type '<>f__AnonymousType2`2' (from assembly 'NHibernate') to 'NHibernate.<>f__AnonymousType2`2'
Duplicate type name: modifying name of the type '<>f__AnonymousType3`2' (from assembly 'NHibernate') to 'NHibernate.<>f__AnonymousType3`2'
Duplicate type name: modifying name of the type '<>f__AnonymousType4`2' (from assembly 'NHibernate') to 'NHibernate.<>f__AnonymousType4`2'
Assembly level attribute 'System.Security.AllowPartiallyTrustedCallersAttribute' from assembly 'NHibernate' being deleted from target assembly
Copying 1 Win32 Resources from assembly 'NHibernate.Validator' into target assembly.
ILMerge: Signing assembly with the key file 'SharpArch.Core\SharpArch.snk'.
    There were no errors reported in the target assembly's metadata.
ILMerge: Writing target assembly 'SharpArchitecture.dll'.
An exception occurred during merging:
Unresolved assembly reference not allowed: NHibernate.
   at System.Compiler.Ir2md.GetAssemblyRefIndex(AssemblyNode assembly)
   at System.Compiler.Ir2md.GetTypeRefIndex(TypeNode type)
   at System.Compiler.Ir2md.VisitReferencedType(TypeNode type)
   at System.Compiler.Ir2md.VisitMethodCall(MethodCall call)
   at System.Compiler.Ir2md.VisitAssignmentStatement(AssignmentStatement assignment)
   at System.Compiler.Ir2md.VisitBlock(Block block)
   at System.Compiler.Ir2md.VisitBlock(Block block)
   at System.Compiler.Ir2md.VisitMethodBody(Method method)
   at System.Compiler.Ir2md.VisitMethod(Method method)
   at System.Compiler.Ir2md.VisitClass(Class Class)
   at System.Compiler.Ir2md.VisitModule(Module module)
   at System.Compiler.Ir2md.SetupMetadataWriter(String debugSymbolsLocation)
   at System.Compiler.Ir2md.WritePE(Module module, String debugSymbolsLocation, BinaryWriter writer)
   at System.Compiler.Writer.WritePE(String location, Boolean writeDebugSymbols, Module module, Boolean delaySign, String keyFileName, String keyName)
   at System.Compiler.Writer.WritePE(CompilerParameters compilerParameters, Module module)
   at ILMerging.ILMerge.Merge()
   at ILMerging.ILMerge.Main(String[] args)
4

1 に答える 1

0

代わりに次の構文を試してください。

ILMerge.exe /log:"merge.txt" /lib:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5" /lib:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0" /lib:"FullPathToNHibernate" /lib:"FullPathToFluent NHibernate" /out:SharpArchitectureMerged.dll SharpArchitecture.dll NHibernate.Validator.dll NHibernate.dll /keyfile:"SharpArch.Core\SharpArch.snk"

基本的には、
1. 出力アセンブリを /out に渡します
2. プライマリ アセンブリは、/out スイッチの後の最初のパラメーターです 3. /lib スイッチを使用して完全なライブラリ パスを渡します

または、次のように、参照されているアセンブリの完全なファイル パスを指定できます。

ILMerge.exe /log:"merge.txt" /lib:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5" /lib:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0" /out:SharpArchitectureMerged.dll SharpArchitecture.dll "FullPathToNHibernate\NHibernate.Validator.dll" "FullPathToFluent NHibernate\NHibernate.dll" /keyfile:"SharpArch.Core\SharpArch.snk"

現在のディレクトリが部分パス参照などを解決していないと思います。

NHibernate.Validator.dll は、NHibernate.dll の特定の厳密な名前のバージョンを探している可能性もあります。

于 2011-12-21T03:31:25.677 に答える