Package Exports
- @nx/dotnet
- @nx/dotnet/generators.json
- @nx/dotnet/generators/init/schema
- @nx/dotnet/generators/init/schema.json
- @nx/dotnet/migrations.json
- @nx/dotnet/package.json
- @nx/dotnet/plugin
Readme
Note: The
@nx/dotnetplugin is currently experimental. Features and APIs may change.
Nx: Smart Repos · Fast Builds
Get to green PRs in half the time. Nx optimizes your builds, scales your CI, and fixes failed PRs. Built for developers and AI agents.
Build .NET with Nx
The goal of @nx/dotnet is to make it easy and straightforward to build .NET applications in an Nx workspace. It provides intelligent project graph analysis, automatic dependency detection, and smart target configuration using MSBuild.
Getting Started
Step 1: Add the .NET plugin to your Nx workspace
nx add @nx/dotnetStep 2: Configure the plugin in your nx.json
{
"plugins": ["@nx/dotnet"]
}Step 3: Create your .NET projects
# Create a console application
dotnet new console -n MyApp
# Create a class library
dotnet new classlib -n MyLibrary
# Create a test project
dotnet new xunit -n MyApp.TestsThe plugin will automatically detect your .NET projects and configure appropriate Nx targets.
Step 4: Run Build, Test, and other commands
# Build a project
nx build my-app
# Run tests
nx test my-app-tests
# Build with Release configuration
nx build my-app --configuration Release
# Create a NuGet package
nx pack my-library
# Publish an application
nx publish my-appGetting Started
Creating an Nx Workspace
Using npx
npx create-nx-workspaceUsing npm init
npm init nx-workspaceUsing yarn create
yarn create nx-workspaceAdding Nx to an Existing Repository
Run:
npx nx@latest init