Instructions for building duplicati on windows

I’m trying to build duplicati from the source on Windows 10 (I’m trying to add some logging to analyze Restore fails when creating empty files at the end of restore process)

I’m familiar with java but not really familiar with .net

I’ve seen How to build from source · duplicati/duplicati Wiki · GitHub and installed Visual Rules Studio Community 2019 and I’ve also tried to install Download Visual Studio 2019 for Windows & Mac.

Building with the VS IDE Fails and building with the build tools on the cli fail as well:

"C:\work\oss\duplicati\src3\Duplicati CommandLine Only.sln" (Standardziel) (1) ->
"C:\work\oss\duplicati\src3\Duplicati\Library\Utility\Duplicati.Library.Utility.csproj" (Standardziel) (2) ->
"C:\work\oss\duplicati\src3\Duplicati\Library\Localization\Duplicati.Library.Localization.csproj" (Standardziel) (4:2) ->
(ResolveAssemblyReferences Ziel) ->
  C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2084,5): warning MSB3245: Dieser Verweis konnte nicht aufgelöst werden. Die "NGettext, Version=0.6.1.0, Culture
=neutral, processorArchitecture=MSIL"-Assembly wurde nicht gefunden. Stellen Sie sicher, dass die Assembly auf dem Datenträger vorhanden ist. Falls dieser Verweis im Code erforderlich ist, können Kompilierungsfehler auftreten. [C:\work\
oss\duplicati\src3\Duplicati\Library\Localization\Duplicati.Library.Localization.csproj]


"C:\work\oss\duplicati\src3\Duplicati CommandLine Only.sln" (Standardziel) (1) ->
"C:\work\oss\duplicati\src3\Duplicati\Library\Utility\Duplicati.Library.Utility.csproj" (Standardziel) (2) ->
"C:\work\oss\duplicati\src3\Duplicati\Library\Common\Duplicati.Library.Common.csproj" (Standardziel) (3:2) ->
(EnsureNuGetPackageBuildImports Ziel) ->
  C:\work\oss\duplicati\src3\Duplicati\Library\Common\Duplicati.Library.Common.csproj(106,5): error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more info
rmation, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\..\..\packages\AlphaVSS.1.4.0\build\net45\AlphaVSS.targets.


"C:\work\oss\duplicati\src3\Duplicati CommandLine Only.sln" (Standardziel) (1) ->
"C:\work\oss\duplicati\src3\Duplicati\Library\Utility\Duplicati.Library.Utility.csproj" (Standardziel) (2) ->
"C:\work\oss\duplicati\src3\Duplicati\Library\Localization\Duplicati.Library.Localization.csproj" (Standardziel) (4:2) ->
(CoreCompile Ziel) ->
  MoLocalizationService.cs(24,7): error CS0246: Der Typ- oder Namespacename "NGettext" wurde nicht gefunden (möglicherweise fehlt eine using-Direktive oder ein Assemblyverweis). [C:\work\oss\duplicati\src3\Duplicati\Library\Localization
\Duplicati.Library.Localization.csproj]
  MoLocalizationService.cs(36,26): error CS0246: Der Typ- oder Namespacename "ICatalog" wurde nicht gefunden (möglicherweise fehlt eine using-Direktive oder ein Assemblyverweis). [C:\work\oss\duplicati\src3\Duplicati\Library\Localizatio
n\Duplicati.Library.Localization.csproj]


"C:\work\oss\duplicati\src3\Duplicati CommandLine Only.sln" (Standardziel) (1) ->
"C:\work\oss\duplicati\src3\Duplicati\Library\Main\Duplicati.Library.Main.csproj" (Standardziel) (6) ->
"C:\work\oss\duplicati\src3\Duplicati\Library\Snapshots\Duplicati.Library.Snapshots.csproj" (Standardziel) (9:2) ->
(EnsureNuGetPackageBuildImports Ziel) ->
  C:\work\oss\duplicati\src3\Duplicati\Library\Snapshots\Duplicati.Library.Snapshots.csproj(134,5): error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For mor
e information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\..\..\packages\AlphaVSS.1.4.0\build\net45\AlphaVSS.targets.


"C:\work\oss\duplicati\src3\Duplicati CommandLine Only.sln" (Standardziel) (1) ->
"C:\work\oss\duplicati\src3\Duplicati\Library\Main\Duplicati.Library.Main.csproj" (Standardziel) (6) ->
"C:\work\oss\duplicati\src3\Duplicati\Library\SQLiteHelper\Duplicati.Library.SQLiteHelper.csproj" (Standardziel) (10:2) ->
  C:\work\oss\duplicati\src3\Duplicati\Library\SQLiteHelper\Duplicati.Library.SQLiteHelper.csproj(117,5): error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  F
or more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\..\..\packages\System.Data.SQLite.Core.1.0.111.0\build\net46\System.Data.SQLite.Core.targets.

    1 Warnung(en)
    5 Fehler

Are there any more detailed instructions for how to build? I will not develop any fancy features, I just want to add some more detailed logging so no need of an IDE if not needed.

You might need to restore the NuGet packages.

Thank you! I tried to follow this NuGet Package Restore | Microsoft Learn but running

msbuild -t:restore “Duplicati CommandLine Only.sln”

just outputs that there is nothing to restore (sorry that the output is german, I don’t have a clue how to change the language of the buildtools to english)

Restore:
  Keine Aktion erforderlich. Keines der angegebenen Projekte enthält wiederherzustellende Pakete.
Die Erstellung von Projekt "C:\work\oss\duplicati\src3\Duplicati CommandLine Only.sln" ist abgeschlossen (Restore Ziel(
e)).

How are other developer building duplicati? Older versions seems to have included a .bat file for building but it looks that this is not there anymore?

I use VS 2019 Community Edition, open Duplicati.sln, and build it in the IDE. No issues at all as long as the correct NET Framework targeting packs are installed. I recently rebuilt my dev VM and didn’t even have to manually install NuGet this time.

Most IDEs should automatically check to see if NuGet packages need to be restored, so it should be as easy as just running a build from the IDE.

Can you try running nuget restore on Duplicati.sln instead of Duplicati CommandLine Only.sln?

Running msbuild -t:restore "Duplicati.sln" had the same effect. But I’ve reinstalled VS, removed all .NET installation and only kept the necessary one and no I’m able to build it by

  • opening Duplicati.sln in VS 2019 Community
  • Rightclick the first entry in the Solution Explorer “Solution Duplicati”
  • select “Build Solution”

The only question I have left is the question where it outputs the compiled .exe files?

Those end up in the bin/Debug or bin/Release folder.

Thank you! I was able to find the content in Duplicati\Library\Main\bin\Debug