Skip to content
This repository has been archived by the owner on Jan 15, 2023. It is now read-only.

Create new Project from Scratch

Robin Gabriël edited this page Feb 23, 2020 · 9 revisions

Some notes before starting off.

  • Visual Studio 2019 or Visual Studio Code is preferred but any editor can be used.
  • With Chromely you can create x64 applications. You can try building x86 applications but that is not supported.
  • While this article doesn't cover .NET Framework development, the project setup is fairly the same.

If you don't want to build from scratch, you can also Create a Project from Templates.

To create a new project, you will need to create a .NET Core 3 Console Project

If .NET Core is not installed (for ex. running an older version of Visual Studio) you can acquire it from the Visual Studio Installer or you can downloaded it from https://dotnet.microsoft.com/download/dotnet-core/3.0).

To make sure that Visual Studio builds the application for 64-bit, we will need to define this in the Configuration Mananger

Package Version Package Manager .NET CLI
Chromely Nuget Install-Package Chromely -Version 5.0.77 dotnet add package Chromely --version 5.0.77

Or install through the NuGet Package Manager GUI

app/
    chromely.html
DemoChromelyApp.cs
Program.cs
  1. Create a folder called app and in it a html file chromely.html
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Chromely</title>
</head>

<body>
    Hello World!
</body>

</html>

Make sure that the chromely.html file has Copy to Output Directory set to Copy Always. You can check this through the file's Properties Window (Right-click on the file and choose Properties).

  1. Next open Program.cs, and replace the default code with the snippet below.
using Chromely.Core;

namespace My_Chromely_App
{
    class Program
    {
        static void Main(string[] args)
        {
            // basic example of the application builder
            AppBuilder
            .Create()
            .UseApp<DemoChromelyApp>()
            .Build()
            .Run(args);
        }
    }
}
  1. And create the DemoChromelyApp class.
using Chromely;
using Chromely.Core;

namespace My_Chromely_App
{
    class DemoChromelyApp : ChromelyBasicApp
    {
        public override void Configure(IChromelyContainer container)
        {
            base.Configure(container);
            // other container configuration can be placed here
        }
    }
}

You are now ready to build/debug the demo application.

You can remove the console window by changing the Output type of the project from Console Application to Windows Application (Right-click on the project and choose Properties)