1. Introduction
Developing .NET projects (using Avalonia UI as an example in this article) in network-constrained or completely offline environments can present certain challenges. This article provides a complete offline development solution, including IDE installation, configuration of Avalonia UI templates, deployment of a private NuGet service, and the creation and upload of NuGet packages.
2. IDE Installation Guide
Visual Studio 2022 Installation
Visual Studio 2022 is Microsoft's latest IDE and supports Avalonia UI project development. The detailed offline installation steps are as follows:
- Creating an Offline Installer: First, follow the guide by user sailJs on VS2022 Offline Installer to create an offline installer for Visual Studio 2022.
- Installing Avalonia UI Extension: After installing Visual Studio, download and install the Avalonia for Visual Studio 2022 extension from the Visual Studio Marketplace.

- Installation failures encountered

Based on a solution from @rabbitism in a WeChat group (thanks to @daidai_cn for assistance), you can extract the extension file, delete the Extension.vsext file highlighted in the image below, and then install:

Successfully installed:

JetBrains Rider Installation
JetBrains Rider IDE has built-in support for Avalonia XAML since version 2020.3, including first-class support for Avalonia-specific XAML features and custom code inspections.
Offline installer download link: Download Rider: Cross-Platform .NET IDE (jetbrains.com)
3. Installing Avalonia UI Templates
For online installation, please refer to the Avalonia Docs. For offline installation, click Avalonia.Templates to download:

Install via the .NET CLI command as shown in the image:
dotnet new install avalonia.templates.11.0.10.1.nupkg

Now you can create new projects using Avalonia UI templates in both Visual Studio and JetBrains Rider.
Avalonia UI templates in VS 2022:

Using templates in Rider:

4. Deploying a Private NuGet Service
After creating a project, the program still cannot run normally because the default template depends on some Avalonia UI NuGet packages that require online installation. You could copy the relevant libraries to the internal network, but copying and referencing them one by one is cumbersome.
To facilitate sharing and managing NuGet packages among team members, you can consider deploying a private NuGet service. This article recommends using BaGet as a lightweight NuGet server. Refer to the BaGet project documentation:
- Install the .NET Core 3.1 SDK (the latest .NET version supported by this program; feel free to clone and modify it to
.NET 8/9– there are surprises in PRs, with community PRs upgrading branches); - Download the latest release archive from Releases · loic-sharma/BaGet;
- Run the service:
dotnet BaGet.dll; - Open a browser and navigate to
http://localhost:5000:

OK, deployment is complete.
5. Creating NuGet Packages (Optional)
There are many online tutorials. You can simply configure the project file of your library to support NuGet package generation. Refer to CodeWF.EventBus as an example:
<Project>
<PropertyGroup>
<Company>https://codewf.com</Company>
<Authors>沙漠尽头的狼</Authors>
<Owners>https://codewf.com</Owners>
<AssemblyVersion>$(Version)</AssemblyVersion>
<FileVersion>$(Version)</FileVersion>
<Version>$(Version)</Version>
<Description>通过 CodeWF.EventBus 提供的 事件总线,我们可以很轻松的实现 CQRS 模式。根据业务需求,我们可以创建并维护读模型,将读操作和写操作进行分离,从而提高应用程序的可扩展性和性能。可在各种模板项目使用:WPF、Winform、AvaloniaUI、ASP.NET Core等。The CodeWF.EventBus allows us to easily implement the CQRS mode. According to business requirements, we can create and maintain a read model to separate read and write operations, thereby improving the scalability and performance of the application. Can be used in various template projects: WPF, Winform, AvaloniaUI, ASP. NET Core, etc.</Description>
<ApplicationIcon>Resources\logo.ico</ApplicationIcon>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Title>$(AssemblyName)</Title>
<Copyright>Copyright © https://codewf.com 2024</Copyright>
<AssemblyName>$(AssemblyName)</AssemblyName>
<RootNamespace>$(AssemblyName)</RootNamespace>
<PackageId>$(AssemblyName)</PackageId>
<PackageTags>C# EventBus; WPF; Winform; AvaloniaUI,ASP.NET Core;</PackageTags>
<PackageIcon>logo.png</PackageIcon>
<PackageProjectUrl>https://github.com/dotnet9/CodeWF.EventBus</PackageProjectUrl>
<RepositoryUrl>https://github.com/dotnet9/CodeWF.EventBus</RepositoryUrl>
</PropertyGroup>
<ItemGroup>
<None Include="Resources\logo.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
</Project>
When you build the library project, the corresponding NuGet file will be generated. The published NuGet package address is: https://www.nuget.org/packages/CodeWF.EventBus
6. Uploading NuGet Packages
You can upload your own NuGet packages or those downloaded from the NuGet official website or third parties.
Open the homepage of your deployed NuGet server at http://localhost:5000:

Click Upload a package and switch to the NuGet package upload command instructions:

We'll use .NET CLI to upload a NuGet package as an example. First, prepare the NuGet file. For instance, download the base package for Avalonia UI by searching on the NuGet official site:


After downloading, open a CMD command prompt in the download directory and run:
dotnet nuget push -s http://localhost:5000/v3/index.json avalonia.11.1.0-rc1.nupkg

The above message indicates that the NuGet service has an API key configured. For simplicity, stop the NuGet service, open its configuration file appsettings.json, clear the ApiKey node value, and then restart the NuGet service:

Then execute the upload command again. It now succeeds:

The package can also be searched on the NuGet homepage:

7. Configuring the NuGet Source in the IDE
Copy the URL highlighted in red from the NuGet upload page: http://localhost:5000/v3/index.json, and configure it as the NuGet search address in VS:

The rest is the same as with regular package installation.
Tip: For temporary personal development, you can configure the above source to a local NuGet directory path.
8. Conclusion
This article introduced how to successfully install and configure the development tools and templates required for Avalonia UI in a local network environment, as well as how to deploy a private NuGet service and create and upload NuGet packages to facilitate sharing and management among team members.
We hope this information helps you with your Avalonia UI project development. If you have any further questions, feel free to ask.