Ich entschied mich, die Zip-Aufgabe von MSBuild Extension zu verwenden, um bei jedem Build etwas von meinem Quellcode zu komprimieren. JedochWie wird die Zip-Aufgabe der MSBuild-Erweiterung verwendet?
, das nicht funktioniert:
<UsingTask TaskName="MSBuild.ExtensionPack.Compression.Zip" AssemblyFile="MSBuild.ExtensionPack.dll" />
<Target Name="AfterBuild">
<CallTarget Targets="ZipSourceFiles" />
</Target>
<Target Name="ZipSourceFiles" Condition="'$(ConfigTransform)'=='ImRunningOnTheServer'">
<MSBuild.ExtensionPack.Compression.Zip TaskAction="Create" CompressFiles="c:\source.txt" ZipFileName="C:\target.zip"/>
</Target>
Ich habe die folgende Fehlermeldung:
The "MSBuild.ExtensionPack.Compression.Zip" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "c:\Windows\Microsoft.NET\Framework\v4.0.30319" directory.
Ich weiß nicht, was diesen Fehler verursacht? Irgendeine Idee?
Muss * das * MSBuild Extension Pack sein? Ich habe das nie benutzt, aber ich könnte Ihnen stattdessen ein funktionierendes Beispiel für [MSBuild Community Tasks] (https://github.com/loresoft/msbuildtasks) geben. –
Es muss nicht dieses Paket sein. Es muss nur die Dateien richtig zippen :) – Zsolt