Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions FIX_BUILD_ERRORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Fix for Build Errors in Intersect.Editor

## Issue
The build was failing with errors related to missing `Microsoft.Data.Sqlite` namespace and types.

## Root Cause
The NuGet packages (`Microsoft.Data.Sqlite` and `SQLitePCLRaw.bundle_e_sqlite3`) were not properly restored on your machine.

## Changes Made
1. Updated `Microsoft.Data.Sqlite` package version from 8.0.0 to 8.0.11 (to match other projects)
2. Added `NuGet.config` to ensure proper package restoration
3. Created helper scripts for easy restoration and building

## How to Fix

### Option 1: Using Visual Studio
1. Open the solution in Visual Studio
2. Right-click on the solution in Solution Explorer
3. Select "Restore NuGet Packages"
4. Rebuild the solution

### Option 2: Using the Command Line
Run one of the provided scripts from the repository root:

**PowerShell:**
```powershell
.\restore-and-build-editor.ps1
```

**Command Prompt:**
```cmd
restore-and-build-editor.bat
```

### Option 3: Using dotnet CLI
```bash
dotnet restore Intersect.Editor/Intersect.Editor.csproj
dotnet build Intersect.Editor/Intersect.Editor.csproj
```

## Verification
After running any of the above options, the build should complete successfully without the `CS0234` and `CS0246` errors.

The warning about `Mono.Data.Sqlite.Portable` being incompatible is expected and can be ignored as we're now using `Microsoft.Data.Sqlite` instead.
2 changes: 1 addition & 1 deletion Intersect.Editor/Intersect.Editor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.0" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.11" />
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.1.10" />
<PackageReference Include="MonoGame.Framework.WindowsDX" Version="3.8.1.303" />
<PackageReference Include="System.Collections.Concurrent" Version="4.3.0" />
Expand Down
11 changes: 11 additions & 0 deletions Intersect.Editor/NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
</configuration>
22 changes: 22 additions & 0 deletions restore-and-build-editor.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@echo off
REM Batch script to restore NuGet packages and build the Intersect Editor
REM This script ensures all dependencies are properly restored before building

echo Restoring NuGet packages for Intersect.Editor...
dotnet restore "%~dp0Intersect.Editor\Intersect.Editor.csproj"

if %ERRORLEVEL% EQU 0 (
echo Packages restored successfully!
echo Building Intersect.Editor...
dotnet build "%~dp0Intersect.Editor\Intersect.Editor.csproj" --configuration Debug

if %ERRORLEVEL% EQU 0 (
echo Build completed successfully!
) else (
echo Build failed. Please check the error messages above.
exit /b 1
)
) else (
echo Package restore failed. Please check your internet connection and NuGet configuration.
exit /b 1
)
21 changes: 21 additions & 0 deletions restore-and-build-editor.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# PowerShell script to restore NuGet packages and build the Intersect Editor
# This script ensures all dependencies are properly restored before building

Write-Host "Restoring NuGet packages for Intersect.Editor..." -ForegroundColor Green
dotnet restore "$PSScriptRoot\Intersect.Editor\Intersect.Editor.csproj"

if ($LASTEXITCODE -eq 0) {
Write-Host "Packages restored successfully!" -ForegroundColor Green
Write-Host "Building Intersect.Editor..." -ForegroundColor Green
dotnet build "$PSScriptRoot\Intersect.Editor\Intersect.Editor.csproj" --configuration Debug

if ($LASTEXITCODE -eq 0) {
Write-Host "Build completed successfully!" -ForegroundColor Green
} else {
Write-Host "Build failed. Please check the error messages above." -ForegroundColor Red
exit 1
}
} else {
Write-Host "Package restore failed. Please check your internet connection and NuGet configuration." -ForegroundColor Red
exit 1
}
Loading