Forum

C# merge all dlls i...
 
Powiadomienia
Wyczyść wszystko

C# merge all dlls into one exe file using ILRepack.Lib.MSBuild.Task

1 Wpisy
1 Użytkownicy
0 Reactions
1,474 Widoki
0
Rozpoczynający temat

example

1 odpowiedź
0
Rozpoczynający temat
  1. inside NuGet console, type
      Install-Package ILRepack.Lib.MSBuild.Task
    
  2. inside directory where is *.csproj create ILRepack.targets file
  3. <?xml version="1.0" encoding="utf-8" ?>
    <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
        <Target Name="ILRepacker" AfterTargets="Build" Condition="'$(Configuration)' == 'Release'">
    
        <ItemGroup>
    	<InputAssemblies Include="$(OutputPath)$(TargetName)$(TargetExt)" />
            <InputAssemblies Include="$(OutputPath)MyAnotherDll.dll" />
        </ItemGroup>
    
        <ILRepack
    	  Parallel="true"
          DebugInfo="true"
          AllowDuplicateResources="false"
          InputAssemblies="@(InputAssemblies)"
          TargetKind="SameAsPrimaryAssembly"
          KeyFile="$(KeyFile)"
          OutputFile="$(OutputPath)merged\$(TargetName)$(TargetExt)"
        />
    
        </Target>
    </Project>
  4. this configuration also repair's error
    The process cannot access the file 'bin\Debug\MyAssembly.pdb' because it is being used by another process.
  5. switch project to RELEASE, now run or compile
  6. merged file is inside _PROJECT_\bin\Release\merged

Twoja odpowiedź

Nazwa autora

E-mail autora

Twoje zapytanie *

 
Podgląd 0 rewizje Zapisano
Udostępnij: