What .NET Version Does OfficeCLI Use?
OfficeCLI targets .NET 10.0, as specified in the <TargetFramework>net10.0</TargetFramework> element within the officecli.csproj file.
The iOfficeAI/OfficeCLI repository provides command-line utilities for Microsoft Office document manipulation. Understanding what .NET version OfficeCLI uses is essential for developers building extensions or contributing to the codebase. According to the source code, the project is explicitly configured to run on the .NET 10.0 runtime.
Verifying the Target Framework in Source Code
The definitive configuration resides in the project file. In src/officecli/officecli.csproj, the target framework is declared within a PropertyGroup element.
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
This setting instructs the .NET SDK to compile the application against the .NET 10.0 API surface. When the runtime hosts the application entry point in Program.cs, it executes within the .NET 10.0 environment.
Checking the .NET Version Locally
You can verify the runtime requirements using command-line tools before installation or when troubleshooting compatibility issues.
Inspect the Compiled Binary
If OfficeCLI is installed, check its runtime dependencies:
# Query the runtime information
dotnet --info | grep "Version"
Alternatively, if the CLI implements a version flag:
officecli --version
Examine the Project File Directly
When working with the source code from the iOfficeAI/OfficeCLI repository:
cat src/officecli/officecli.csproj | grep "TargetFramework"
Building Compatible Extensions
To develop plugins or standalone tools that interact with OfficeCLI, you must target .NET 10.0 to ensure binary compatibility.
Creating a New .NET 10.0 Project
Initialize a console application that matches OfficeCLI's target framework:
dotnet new console -f net10.0 -o MyOfficeTool
cd MyOfficeTool
dotnet run
Referencing OfficeCLI in Your Project
Add OfficeCLI as a dependency in your extension's project file:
<!-- In your .csproj file -->
<ItemGroup>
<PackageReference Include="OfficeCli" Version="x.y.z" />
</ItemGroup>
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
Summary
- OfficeCLI is built for .NET 10.0, as defined in
src/officecli/officecli.csproj. - The
<TargetFramework>net10.0</TargetFramework>element establishes the minimum required runtime version. - The application entry point in
Program.csexecutes within the .NET 10.0 environment. - Third-party extensions must target
net10.0to maintain compatibility with OfficeCLI's API surface.
Frequently Asked Questions
What .NET version does OfficeCLI use?
OfficeCLI requires the .NET 10.0 runtime. The officecli.csproj file explicitly sets <TargetFramework>net10.0</TargetFramework>, meaning the application will only execute on systems with .NET 10.0 installed.
Can I run OfficeCLI on .NET 8 or .NET 9?
No. Because OfficeCLI targets .NET 10.0 specifically and utilizes APIs available only in that version, it is not backward compatible with .NET 8 or .NET 9 runtimes. You must install .NET 10.0 to use the CLI.
Where is the .NET version defined in the OfficeCLI repository?
The .NET version is defined in src/officecli/officecli.csproj within the <TargetFramework> XML element. This project file serves as the single source of truth for the framework version requirements.
Can I reference OfficeCLI libraries from a .NET 6 project?
No. Since OfficeCLI targets .NET 10.0, you cannot reference it from a .NET 6 project. You must upgrade your project to target net10.0 in your .csproj file to consume OfficeCLI packages successfully.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →