> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neuro-tech.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Build your first package

> Compile and install a minimal Neuron module using NuGet

This guide creates an assembly package that writes an event when the Neuron starts.

## Prerequisites

* A local [Neuron installation](/operations/install) that you can stop and start.
* The .NET SDK.
* PowerShell.
* The Neuron application folder, program-data folder, and Windows service name.

<Note>
  The sample below was build-tested with Waher.IoTGateway 3.10.2. Use the version that matches your installed Neuron when they differ.
</Note>

## 1. Create the project

```powershell theme={null}
mkdir HelloNeuron
cd HelloNeuron
dotnet new classlib --framework netstandard2.1
dotnet add package Waher.IoTGateway --version 3.10.2
```

The package targets .NET Standard 2.1 because the public runtime package targets that framework.

## 2. Configure the project

Replace HelloNeuron.csproj with:

```xml theme={null}
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netstandard2.1</TargetFramework>
    <Nullable>enable</Nullable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Waher.IoTGateway" Version="3.10.2" />
  </ItemGroup>

  <ItemGroup>
    <None Include="HelloNeuron.manifest"
          CopyToOutputDirectory="PreserveNewest" />
  </ItemGroup>
</Project>
```

## 3. Add a module

Delete Class1.cs and create HelloNeuronModule.cs:

```csharp theme={null}
using System.Threading.Tasks;
using Waher.Events;
using Waher.Runtime.Inventory;

namespace HelloNeuron
{
    public sealed class HelloNeuronModule : IModule
    {
        public Task Start()
        {
            Log.Informational("HelloNeuron started.");
            return Task.CompletedTask;
        }

        public Task Stop()
        {
            Log.Informational("HelloNeuron stopped.");
            return Task.CompletedTask;
        }
    }
}
```

The runtime discovers concrete IModule implementations and calls Start after loading the assembly.

## 4. Add the manifest

Create HelloNeuron.manifest next to the project file:

```xml theme={null}
<Module xmlns="http://waher.se/Schema/ModuleManifest.xsd">
  <Assembly fileName="HelloNeuron.dll" />
</Module>
```

The manifest lists every assembly and content file installed by the package.

## 5. Build

```powershell theme={null}
dotnet build --configuration Release
```

Verify that the output folder contains:

```text theme={null}
bin/Release/netstandard2.1/
|-- HelloNeuron.dll
`-- HelloNeuron.manifest
```

Warnings about a transitive dependency resolving to a newer patch version come from the published runtime package. Review them against the target Neuron instead of suppressing all NuGet warnings.

## 6. Install in the local Neuron

Set these values from your installation:

```powershell theme={null}
$NeuronService = "<NEURON_SERVICE_NAME>"
$NeuronApp = "<NEURON_APPLICATION_FOLDER>"
$NeuronData = "<NEURON_PROGRAM_DATA_FOLDER>"
$Installer = Join-Path $NeuronApp "InstallUtility\Waher.Utility.Install.exe"
$Server = Join-Path $NeuronApp "Waher.IoTGateway.Svc.exe"
$Manifest = Resolve-Path ".\bin\Release\netstandard2.1\HelloNeuron.manifest"
```

Stop the service, install from the manifest, and restart:

```powershell theme={null}
Stop-Service -Name $NeuronService
& $Installer -m $Manifest -s $Server -d $NeuronData -v
Start-Service -Name $NeuronService
```

The executable and data paths can differ between installer versions. Read the Windows service PathName and the Neuron configuration instead of copying paths from another machine.

## 7. Verify

Open the Neuron event log and search for:

```text theme={null}
HelloNeuron started.
```

If the event is present, the runtime found the assembly, created the module, and called Start.

## Next step

* Add an [HTTP resource or content handler](/neuron-development/http-content-and-protocols).
* Add [persistence and structured events](/neuron-development/persistence-and-events).
* Build a [custom MCP server](/mcp/build-a-server).
* Create a signed package for distribution with [Build packages](/neuron-development/building-packages).
