{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Getting Started with the IIoT Edge App .NET SDK","description":"Accelerate E&P application development and protect your innovation by consuming our Data and Domain APIs / Platform APIs.","lang":"en-US","meta":[{"name":"robots","content":"noindex"}],"llmstxt":{"hide":true,"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"getting-started-with-the-iiot-edge-app-net-sdk","__idx":0},"children":["Getting Started with the IIoT Edge App .NET SDK"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The .NET SDK provides functionality for developing .NET edge applications using .NET6.0 and above."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The .NET SDK is distributed on Nuget as ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://www.nuget.org/packages/AgoraIoT.Edge.App.SDK"},"children":["AgoraIoT.Edge.App.SDK"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Several methods for getting started are provided using several environments, including:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Command Line"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Visual Studio (Community, Pro, etc.)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Visual Studio Code"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"create-a-console-app","__idx":1},"children":["Create a Console App"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Pick the method you would like to create a new Console App."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"creating-an-iiot-edge-app-using-visual-studio-2022-and-net-core-8","__idx":2},"children":["Creating an IIoT Edge App using Visual Studio 2022 and .NET Core 8"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create Console App:"]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Start Visual Studio."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Create a new project targeting a Console App (",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["File > New Project..."]},")."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Enter a Project Name, Location, and Solution Name."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["For the framework select .NET Core 8 (Long-term support)."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Add 'AgoraIoT.Edge.App.SDK' NuGet Package:"]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["On the Solution Explorer, right click on the solution and select ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Manage Nuget Packages for Solution"]}]}," to bring up the NuGet Package Manager."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click the check box ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Include prerelease"]}]}," and make sure the ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Package Source"]}]}," is set to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Nuget"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Search for ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["AgoraIoT"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["AgoraIoT.Edge.App.SDK"]}," in the list of packages."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Agree to the License Agreement."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"creating-an-iiot-edge-app-using-visual-studio-code-and-net-core-8","__idx":3},"children":["Creating an IIoT Edge App using Visual Studio Code and .NET Core 8"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create Console App:"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Follow the Microsoft ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio-code?pivots=dotnet-6-0"},"children":["tutorial"]}," to create a Console app, ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["EXCEPT"]}," in Step 6 run the following commands:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"> dotnet new console -n ProjectName -f net8.0 --use-program-main\n> cd ProjectName\n> dotnet add ProjectName.csproj package AgoraIoT.Edge.App.SDK --version 1.0.11-beta\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"creating-an-iiot-edge-app-using-command-line-and-net-core-8","__idx":4},"children":["Creating an IIoT Edge App using Command Line and .NET Core 8"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create Console App:"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["From folder where you want to create a project within, enter"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"> dotnet new console -n ProjectName -f net8.0 --use-program-main\n> cd ProjectName\n> dotnet add ProjectName.csproj package AgoraIoT.Edge.App.SDK --version 1.0.11-beta\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"hello-world","__idx":5},"children":["\"Hello World!\""]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Replace the code in ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["Program.cs"]}," with the following code and run the application:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"dotnet","header":{"controls":{"copy":{}}},"source":"\"Hello World!\".LogInfo();\n","lang":"dotnet"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"creating-an-edge-application-container-image","__idx":6},"children":["Creating an Edge Application Container Image"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Using the Dockerfile.sample provided within the application, create a Dockerfile for your project."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"dockerfile","header":{"controls":{"copy":{}}},"source":"#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.\n\nFROM mcr.microsoft.com/dotnet/runtime-deps:8.0-alpine AS base\nWORKDIR /app\n\nFROM mcr.microsoft.com/dotnet/sdk:8.0 AS build\n\nWORKDIR /src\nCOPY src/. /src\n\nRUN dotnet restore \"ConsoleApp/ConsoleApp.csproj\" -r linux-musl-x64\nRUN dotnet build \"ConsoleApp/ConsoleApp.csproj\" -c Release -o /app/build --no-restore -r linux-musl-x64\n\nFROM build AS publish\nRUN dotnet publish \"ConsoleApp/ConsoleApp.csproj\" -p:PublishSingleFile=true -r linux-musl-x64 --self-contained true -p:PublishTrimmed=False -p:TrimMode=Link -c Release -o /app/publish --no-restore\n\nFROM base AS final\nWORKDIR /app\nCOPY --from=publish /app/publish .\nENTRYPOINT [\"./ConsoleApp\"]\n","lang":"dockerfile"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create your docker container by running the following command within the project folder with the Dockerfile:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"> docker build .\n","lang":"bash"},"children":[]}]},"headings":[{"value":"Getting Started with the IIoT Edge App .NET SDK","id":"getting-started-with-the-iiot-edge-app-net-sdk","depth":1},{"value":"Create a Console App","id":"create-a-console-app","depth":2},{"value":"Creating an IIoT Edge App using Visual Studio 2022 and .NET Core 8","id":"creating-an-iiot-edge-app-using-visual-studio-2022-and-net-core-8","depth":3},{"value":"Creating an IIoT Edge App using Visual Studio Code and .NET Core 8","id":"creating-an-iiot-edge-app-using-visual-studio-code-and-net-core-8","depth":3},{"value":"Creating an IIoT Edge App using Command Line and .NET Core 8","id":"creating-an-iiot-edge-app-using-command-line-and-net-core-8","depth":3},{"value":"\"Hello World!\"","id":"hello-world","depth":4},{"value":"Creating an Edge Application Container Image","id":"creating-an-edge-application-container-image","depth":2}],"frontmatter":{"seo":{"title":"Getting Started with the IIoT Edge App .NET SDK"}},"lastModified":"2026-01-14T00:18:30.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/solutions/agora/gettingstarteddotnet","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}