tags: - installation - setup - nuget - getting-started
Installation¶
This guide covers the prerequisites and setup required to use EverSharp in your .NET projects.
Prerequisites¶
Required¶
- .NET 9.0 SDK or later
- Download from dotnet.microsoft.com
- Verify installation:
dotnet --version
Recommended¶
- Visual Studio 2022 (17.8 or later) or Visual Studio Code
- C# development experience for integration scenarios
Installation Methods¶
Method 1: NuGet Package¶
The EverSharp library is available as a NuGet package (package details to be added).
Using .NET CLI:
Using Package Manager Console (Visual Studio):
Using Visual Studio UI:
- Right-click on your project in Solution Explorer
- Select Manage NuGet Packages
- Search for "Elements.Libs.EverSharp"
- Click Install
Method 2: Project Reference¶
If you have access to the source code, you can reference the project directly:
<ItemGroup>
<ProjectReference Include="..\Elements.Libs.EverSharp\Elements.Libs.EverSharp.csproj" />
</ItemGroup>
Verify Installation¶
Create a simple C# file to verify the installation:
using Elements.Libs.EverSharp;
var runner = new EverSharpRunner();
runner.Run("result = 10 + 20;");
if (!runner.HasErrors)
{
var result = runner.GlobalVariables["result"];
Console.WriteLine($"Result: {result}"); // Output: Result: 30
}
else
{
Console.WriteLine("Errors occurred:");
foreach (var error in runner.Errors)
{
Console.WriteLine(error);
}
}
Run the code:
Expected output:
If you see this output, EverSharp is correctly installed and working!
Project Setup¶
Create New Console Application¶
# Create new console app
dotnet new console -n MyEverSharpApp
cd MyEverSharpApp
# Add EverSharp package
dotnet add package Elements.Libs.EverSharp
# Run
dotnet run
Minimum Project File¶
Your .csproj file should target .NET 9.0:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Elements.Libs.EverSharp" Version="*" />
</ItemGroup>
</Project>
Dependencies¶
EverSharp has minimal dependencies. The core library requires:
- Newtonsoft.Json - For JSON serialization
- Elements.Libs.Extensions - Internal extensions library
These dependencies are automatically resolved when you install the NuGet package.
Namespace Imports¶
In your C# files, import the required namespace:
For working with dictionaries and type conversions:
Common Issues¶
Issue: Package Not Found¶
Problem: NuGet package cannot be found
Solution: Ensure you have access to the package feed. You may need to configure authentication for private feeds.
Issue: Target Framework Mismatch¶
Problem: "The current .NET SDK does not support targeting .NET 9.0"
Solution:
- Install .NET 9.0 SDK
- Verify with
dotnet --version - Update your project's
TargetFrameworktonet9.0
Issue: Namespace Not Found¶
Problem: "The type or namespace name 'EverSharpRunner' could not be found"
Solution:
- Ensure package is installed:
dotnet restore - Add using directive:
using Elements.Libs.EverSharp; - Rebuild project:
dotnet build
IDE Setup¶
Visual Studio 2022¶
- Open or create a C# project
- Right-click project → Manage NuGet Packages
- Install Elements.Libs.EverSharp
- Add
using Elements.Libs.EverSharp;to your code
Visual Studio Code¶
- Install C# Dev Kit extension
- Open project folder
- Open integrated terminal
- Run:
dotnet add package Elements.Libs.EverSharp - Add
using Elements.Libs.EverSharp;to your code
JetBrains Rider¶
- Open or create a C# project
- Right-click project → Manage NuGet Packages
- Search and install Elements.Libs.EverSharp
- Add
using Elements.Libs.EverSharp;to your code
Next Steps¶
Now that you have EverSharp installed:
- Try the basics: Hello World
- Learn the API: Using EverSharpRunner
- Explore the language: Data Types