diff --git a/FIX_BUILD_ERRORS.md b/FIX_BUILD_ERRORS.md new file mode 100644 index 0000000000..798c341ece --- /dev/null +++ b/FIX_BUILD_ERRORS.md @@ -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. diff --git a/Intersect.Editor/Intersect.Editor.csproj b/Intersect.Editor/Intersect.Editor.csproj index eab56b4bc3..07db2c0aec 100644 --- a/Intersect.Editor/Intersect.Editor.csproj +++ b/Intersect.Editor/Intersect.Editor.csproj @@ -70,7 +70,7 @@ - + diff --git a/Intersect.Editor/NuGet.config b/Intersect.Editor/NuGet.config new file mode 100644 index 0000000000..6fd1a13787 --- /dev/null +++ b/Intersect.Editor/NuGet.config @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/restore-and-build-editor.bat b/restore-and-build-editor.bat new file mode 100644 index 0000000000..222349095c --- /dev/null +++ b/restore-and-build-editor.bat @@ -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 +) diff --git a/restore-and-build-editor.ps1 b/restore-and-build-editor.ps1 new file mode 100644 index 0000000000..a527b10b71 --- /dev/null +++ b/restore-and-build-editor.ps1 @@ -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 +}