Skip to content

0 ‐ Build

Elwador edited this page Jan 4, 2025 · 3 revisions

Crunchy Downloader Build Guide

This guide explains how to build and run the Avalonia .NET MVVM application for the Crunchy Downloader project.

Important Note

I do not provide support for issues encountered when building the project yourself.

Step 1: Create a New Avalonia Project

  1. Open Visual Studio and select Create a new project.
  2. Choose the Avalonia MVVM App template and click Next.
  3. Set the project name and location to match the repository structure, then click Create.

Step 3: Configure the .csproj File

Replace the content of the .csproj file with the following configuration:

<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <OutputType>WinExe</OutputType>
        <TargetFramework>net8.0</TargetFramework>
        <Nullable>enable</Nullable>
        <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
        <ApplicationManifest>app.manifest</ApplicationManifest>
        <AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
        <SatelliteResourceLanguages>en</SatelliteResourceLanguages>
        <ApplicationIcon>Assets\app_icon.ico</ApplicationIcon>
        <Version>1.1.1.1</Version>
    </PropertyGroup>

    <ItemGroup>
        <AvaloniaResource Include="Assets\**"/>
    </ItemGroup>

    <ItemGroup>
        <PackageReference Include="AsyncImageLoader.Avalonia" Version="3.3.0" />
        <PackageReference Include="Avalonia" Version="11.2.2" />
        <PackageReference Include="Avalonia.Desktop" Version="11.2.2" />
        <PackageReference Include="Avalonia.Fonts.Inter" Version="11.2.2" />
        <PackageReference Include="Avalonia.ReactiveUI" Version="11.2.2" />
        <PackageReference Include="BouncyCastle.Cryptography" Version="2.5.0" />
        <PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
        <PackageReference Include="ExtendedXmlSerializer" Version="3.8.0" />
        <PackageReference Include="FluentAvaloniaUI" Version="2.2.0" />
        <PackageReference Include="HtmlAgilityPack" Version="1.11.71" />
        <PackageReference Include="Newtonsoft.Json" Version="13.0.3"/>
        <PackageReference Include="protobuf-net" Version="3.2.45" />
        <PackageReference Include="SixLabors.ImageSharp" Version="3.1.6" />
        <PackageReference Include="YamlDotNet" Version="16.2.1" />
    </ItemGroup>

    <ItemGroup>
        <UpToDateCheckInput Remove="Styling\ControlsGalleryStyles.axaml" />
        <UpToDateCheckInput Remove="Styling\ControlThemes.axaml" />
        <UpToDateCheckInput Remove="Views\Utils\ErrorWindow.axaml" />
    </ItemGroup>

    <ItemGroup>
        <Compile Update="Views\Utils\ContentDialogUpdateView.axaml.cs">
            <DependentUpon>ContentDialogUpdateView.axaml</DependentUpon>
            <SubType>Code</SubType>
        </Compile>
        <Compile Update="Views\Utils\ContentDialogInputLoginView.axaml.cs">
            <DependentUpon>ContentDialogInputLoginView.axaml</DependentUpon>
            <SubType>Code</SubType>
        </Compile>
    </ItemGroup>
</Project>

Step 4: Add Existing Code

  1. Right-click the project in Solution Explorer.
  2. Select Add -> Existing Item...
  3. Navigate to the CRD folder in the repository and add all .cs and .axaml files.
  4. Ensure that the files are added to the correct folders (ViewModels, Views, Models, etc.).

Step 5: Restore and Build

  1. Right-click the solution and select Restore NuGet Packages.
  2. Make sure all packages are installed successfully.
  3. Build the project using Build -> Build Solution.

Step 6: Run the Application

  1. Press F5 or click Run to launch the application.

License

This project is licensed under the MIT License.