$npx -y skills add tebjan/vvvv-skills --skill vvvv-dotnetHelps with .NET integration in vvvv gamma — NuGet packages, library references, .csproj project configuration, the [assembly: ImportAsIs] attribute, vector type interop, and async patterns. Use when adding NuGet packages, configuring build settings, referencing external .NET libr
| 1 | # .NET Integration in vvvv gamma |
| 2 | |
| 3 | ## .csproj Configuration for vvvv Plugins |
| 4 | |
| 5 | Minimal `.csproj` for a vvvv gamma C# plugin: |
| 6 | |
| 7 | ```xml |
| 8 | <Project Sdk="Microsoft.NET.Sdk"> |
| 9 | <PropertyGroup> |
| 10 | <TargetFramework>net8.0</TargetFramework> |
| 11 | <OutputPath Condition="'$(Configuration)'=='Release'">..\..\lib\net8.0\</OutputPath> |
| 12 | <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> |
| 13 | </PropertyGroup> |
| 14 | |
| 15 | <ItemGroup> |
| 16 | <PackageReference Include="VL.Core" Version="2025.7.*" /> |
| 17 | <PackageReference Include="VL.Stride" Version="2025.7.*" /> |
| 18 | </ItemGroup> |
| 19 | </Project> |
| 20 | ``` |
| 21 | |
| 22 | Key settings: |
| 23 | - **Target framework**: `net8.0` (required for vvvv gamma 6+) |
| 24 | - **Output path**: Point to `lib/net8.0/` relative to your `.vl` document |
| 25 | - **AppendTargetFrameworkToOutputPath**: Set to `false` so DLLs go directly to the output folder |
| 26 | |
| 27 | ### How vvvv Uses C# Code |
| 28 | |
| 29 | There are two workflows for integrating C# with a .vl document: |
| 30 | |
| 31 | **Source project reference** (live reload): The .vl document references a .csproj. vvvv compiles .cs source files itself via Roslyn into in-memory assemblies — no `dotnet build` needed. On every .cs file save, vvvv detects the change and recompiles automatically. The output path in .csproj is not involved during live development; it is used for NuGet packaging and deployment. |
| 32 | |
| 33 | **Binary reference** (no live reload): The .vl document references a pre-compiled DLL or NuGet package. To apply C# changes, rebuild externally (`dotnet build`) and restart vvvv. This is the standard workflow for larger projects and stable libraries. |
| 34 | |
| 35 | Shaders (.sdsl files) always live-reload regardless of workflow. |
| 36 | |
| 37 | **For AI agents**: regardless of workflow, run `dotnet build` to verify your code compiles — you cannot see vvvv's compiler output. For source project references, vvvv picks up changes on file save automatically (no restart needed). For binary references, `dotnet build` is required and the user must restart vvvv. |
| 38 | |
| 39 | ## Required Global Usings |
| 40 | |
| 41 | ```csharp |
| 42 | global using VL.Core; |
| 43 | global using VL.Core.Import; |
| 44 | global using VL.Lib.Collections; |
| 45 | ``` |
| 46 | |
| 47 | ## Required Assembly Attribute |
| 48 | |
| 49 | For vvvv to discover your ProcessNodes and static methods: |
| 50 | |
| 51 | ```csharp |
| 52 | [assembly: ImportAsIs] |
| 53 | ``` |
| 54 | |
| 55 | Without this, your nodes will not appear in the vvvv node browser. |
| 56 | |
| 57 | ## NuGet Package Sources |
| 58 | |
| 59 | Add these to your `NuGet.config` for vvvv packages: |
| 60 | |
| 61 | ```xml |
| 62 | <configuration> |
| 63 | <packageSources> |
| 64 | <add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> |
| 65 | <add key="vvvv" value="https://teamcity.vvvv.org/guestAuth/app/nuget/v1/FeedService.svc/" /> |
| 66 | </packageSources> |
| 67 | </configuration> |
| 68 | ``` |
| 69 | |
| 70 | ## NuGet Packaging |
| 71 | |
| 72 | To distribute your plugin as a NuGet package: |
| 73 | |
| 74 | ```bash |
| 75 | nuget pack MyPlugin/deployment/MyPlugin.nuspec |
| 76 | ``` |
| 77 | |
| 78 | The `.nuspec` should reference your `.vl` document, compiled DLLs, shader files, and help patches. |
| 79 | |
| 80 | ## Common VL Packages |
| 81 | |
| 82 | | Package | Purpose | |
| 83 | |---|---| |
| 84 | | `VL.Core` | Core types, ProcessNode attribute, Spread | |
| 85 | | `VL.Stride` | 3D rendering, shader integration | |
| 86 | | `VL.Stride.Runtime` | Stride engine runtime | |
| 87 | | `VL.Core.Import` | ImportAsIs attribute | |
| 88 | | `VL.Lib.Collections` | Spread, SpreadBuilder | |
| 89 | | `VL.Skia` | 2D rendering (Skia graphics engine) | |
| 90 | | `VL.Fuse` | GPU visual programming (shader graph) | |
| 91 | | `VL.IO.OSC` | Open Sound Control protocol | |
| 92 | | `VL.IO.MQTT` | MQTT messaging | |
| 93 | | `VL.IO.Redis` | Redis key-value store | |
| 94 | | `VL.OpenCV` | Computer vision (OpenCV bindings) | |
| 95 | | `VL.MediaPipe` | MediaPipe ML pipelines (hand, face, pose) | |
| 96 | | `VL.Audio` | Audio synthesis and I/O (NAudio-based) | |
| 97 | | `VL.Devices.AzureKinect` | Azure Kinect / Orbbec depth cameras | |
| 98 | |
| 99 | For a full catalog, see [vvvv.org/packs](https://vvvv.org/packs). |
| 100 | |
| 101 | ## Vector Types & SIMD Strategy |
| 102 | |
| 103 | - **Internal hot paths**: Use `System.Numerics.Vector3/Vector4/Quaternion` (SIMD via AVX/SSE) |
| 104 | - **External API** (Update method params): Use `Stride.Core.Mathematics` types (required by VL) |
| 105 | - **Zero-cost conversion** between them: |
| 106 | |
| 107 | ```csharp |
| 108 | using System.Runtime.CompilerServices; |
| 109 | |
| 110 | // Stride → System.Numerics (zero-cost reinterpret) |
| 111 | ref var numericsVec = ref Unsafe.As<Stride.Core.Mathematics.Vector3, System.Numerics.Vector3>(ref strideVec); |
| 112 | |
| 113 | // System.Numerics → Stride (zero-cost reinterpret) |
| 114 | ref var strideVec = ref Unsafe.As<System.Numerics.Vector3, Stride.Core.Mathematics.Vector3>(ref numericsVec); |
| 115 | ``` |
| 116 | |
| 117 | These types have |