Atc.DotNet
4.1.0
dotnet add package Atc.DotNet --version 4.1.0
NuGet\Install-Package Atc.DotNet -Version 4.1.0
<PackageReference Include="Atc.DotNet" Version="4.1.0" />
<PackageVersion Include="Atc.DotNet" Version="4.1.0" />
<PackageReference Include="Atc.DotNet" />
paket add Atc.DotNet --version 4.1.0
#r "nuget: Atc.DotNet, 4.1.0"
#:package Atc.DotNet@4.1.0
#addin nuget:?package=Atc.DotNet&version=4.1.0
#tool nuget:?package=Atc.DotNet&version=4.1.0
Atc.DotNet
Target Framework: net10.0
Programmatic interface to dotnet.exe and utilities for parsing .NET project files. Provides helpers for executing dotnet commands, analyzing project structure, and extracting metadata from solution and project files.
Why Use This Library?
Automating .NET build processes and analyzing project files requires executing dotnet.exe and parsing project XML. Atc.DotNet simplifies this by providing:
- DotnetHelper: Locate and execute dotnet.exe programmatically
- DotnetBuildHelper: Build projects and collect compilation errors
- DotnetCsProjFileHelper: Parse and analyze .csproj files
- DotnetNugetHelper: Extract NuGet package references
- VisualStudioSolutionFileHelper: Parse .sln files and extract metadata
- Project Type Detection: Identify console apps, libraries, test projects, etc.
Perfect for:
- Build automation tools
- Code generators analyzing project structure
- CI/CD pipeline utilities
- DevOps tooling for .NET projects
- Project scaffolding and templates
- Dependency analysis tools
Installation
dotnet add package Atc.DotNet
Target Framework
- .NET Standard 2.0
- .NET 10.0
Key Features
- Locate dotnet.exe installation directory and executable
- Execute dotnet build with error collection
- Parse .csproj files and extract project type
- Extract NuGet package references from projects
- Parse Visual Studio solution files
- Detect project types (Console, Library, Web, Test, etc.)
- Analyze project dependencies
- Support for both file-based and content-based parsing
- Look up the latest stable version of a NuGet package
Requirements
Key Dependencies
- Atc (foundation library)
Main Components
DotnetHelper
Utilities for locating and working with dotnet.exe:
GetDotnetDirectory(): Finds the dotnet installation directoryGetDotnetExecutable(): Gets the full path to dotnet.exe
DotnetBuildHelper
Build automation and error collection:
BuildAndCollectErrors(): Builds project and returns compilation errors
DotnetCsProjFileHelper
Project file analysis:
PredictProjectType(): Determines project type with file analyticsGetProjectType(): Determines project type from .csproj content
DotnetNugetHelper
NuGet package analysis:
GetAllPackageReferences(): Extracts all package references from project
VisualStudioSolutionFileHelper
Solution file parsing:
GetSolutionFileMetadata(): Extracts metadata from .sln files
Code documentation
DotnetHelper examples
Using GetDotnetDirectory() to find the directory path of dotnet.exe / dotnet - depends on the operating system
DirectoryInfo dotnetDirectory = DotnetHelper.GetDotnetDirectory();
Using GetDotnetExecutable() to find the file path of dotnet.exe / dotnet - depends on the operating system
FileInfo dotnetFile = DotnetHelper.GetDotnetExecutable();
DotnetBuildHelper examples
Using BuildAndCollectErrors(..) to build and collect errors
This method build and collect errors if any - 0 errors is the same as a successful build.
Dictionary<string, int> buildErrors = await DotnetBuildHelper.BuildAndCollectErrors(workingDirectory);
var workingDirectory = new DirectoryInfo(@"c:\code\myproject");
var runNumber = 5;
var buildFile = new FileInfo(@"c:\code\myproject\mylib.csproj"),
var useNugetRestore = true,
var useConfigurationReleaseMode = true,
var timeoutInSec = 20,
var logPrefix = "BUILD-PREFIX";
var cancellationToken = CancellationToken.None;
Dictionary<string, int> buildErrors = await DotnetBuildHelper.BuildAndCollectErrors(
workingDirectory,
runNumber,
buildFile,
useNugetRestore,
useConfigurationReleaseMode,
timeoutInSec,
logPrefix,
cancellationToken);
DotnetCsProjFileHelper examples
Using PredictProjectType(..) to find the DotnetProjectType in a file
var file = new FileInfo(@"c:\code\myproject\mylib.csproj"),
DotnetProjectType projectType = DotnetCsProjFileHelper.PredictProjectType(file);
Note: PredictProjectType use GetProjectType but extend the determinations with surrounded files analytics as looking into the Program.cs.
Using GetProjectType(..) to find the DotnetProjectType in a file or file-content
var file = new FileInfo(@"c:\code\myproject\mylib.csproj"),
DotnetProjectType projectType = DotnetCsProjFileHelper.GetProjectType(file);
DotnetNugetHelper examples
Using GetAllPackageReferences(..) to find package-references in a file or file-content
var file = new FileInfo(@"c:\code\myproject\mylib.csproj"),
List<DotnetNugetPackageMetadataBase> packages = DotnetNugetHelper.GetAllPackageReferences(file);
var file = new FileInfo(@"c:\code\myproject\mylib.csproj"),
var fileContent = File.ReadAllText(file.FullName);
List<DotnetNugetPackageMetadataBase> packages = DotnetNugetHelper.GetAllPackageReferences(fileContent);
VisualStudioSolutionFileHelper examples
Using GetSolutionFileMetadata(..) to find VisualStudio metadata in a file or file-content
var file = new FileInfo(@"c:\code\myproject\mylib.sln"),
VisualStudioSolutionFileMetadata metadata = VisualStudioSolutionFileHelper.GetSolutionFileMetadata(file);
var file = new FileInfo(@"c:\code\myproject\mylib.sln"),
var fileContent = File.ReadAllText(file.FullName);
VisualStudioSolutionFileMetadata metadata = VisualStudioSolutionFileHelper.GetSolutionFileMetadata(file);
Contributing
Contributions are welcome! Please see the main repository README for contribution guidelines.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Atc.DotNet:
| Package | Downloads |
|---|---|
|
Atc.Rest.ApiGenerator
Atc.Rest.ApiGenerator is a WebApi C# code generator using a OpenApi 3.0.x specification YAML file. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.1.0 | 140 | 11/9/2026 |
| 4.0.0 | 763 | 10/19/2026 |
| 3.0.186 | 570 | 8/25/2026 |
| 3.0.185 | 136 | 8/25/2026 |
| 3.0.181 | 223 | 7/29/2026 |
| 3.0.174 | 284 | 6/24/2026 |
| 3.0.173 | 163 | 6/24/2026 |
| 3.0.172 | 156 | 6/24/2026 |
| 3.0.67 | 389 | 4/25/2026 |
| 3.0.46 | 214 | 4/15/2026 |
| 3.0.45 | 157 | 4/10/2026 |
| 3.0.44 | 151 | 4/9/2026 |
| 3.0.43 | 154 | 4/9/2026 |
| 3.0.41 | 158 | 4/9/2026 |
| 3.0.40 | 156 | 4/9/2026 |
| 3.0.18 | 562 | 2/9/2026 |
| 3.0.16 | 707 | 12/15/2025 |
| 3.0.12 | 347 | 11/28/2025 |
| 3.0.9 | 534 | 11/21/2025 |
| 3.0.8 | 432 | 11/14/2025 |