CoplayDev/unity-mcp · error · Exception
No validation paths were set
Error message
No validation paths were set
What it means
Thrown by CurrentProjectValidator.ValidateSettings when ValidationPaths is null or empty. The validator needs at least one path to know what to scan, so it aborts before generating any test config. It is distinct from a 'paths invalid' error (error 145), which fires only when paths are present but missing on disk.
Source
Thrown at TestProjects/AssetStoreUploads/Packages/com.unity.asset-store-tools/Editor/Validator/Scripts/CurrentProjectValidator.cs:24
namespace AssetStoreTools.Validator
{
internal class CurrentProjectValidator : ValidatorBase
{
private CurrentProjectValidationSettings _settings;
public CurrentProjectValidator(CurrentProjectValidationSettings settings) : base(settings)
{
_settings = settings;
}
protected override void ValidateSettings()
{
if (_settings == null)
throw new Exception("Validation Settings is null");
if (_settings.ValidationPaths == null
|| _settings.ValidationPaths.Count == 0)
throw new Exception("No validation paths were set");
switch (_settings.ValidationType)
{
case ValidationType.Generic:
case ValidationType.UnityPackage:
ValidateUnityPackageSettings();
break;
default:
throw new NotImplementedException("Undefined validation type");
}
}
private void ValidateUnityPackageSettings()
{
var invalidPaths = string.Empty;
foreach (var path in _settings.ValidationPaths)
{
if (!Directory.Exists(path))
View on GitHub (pinned to c21bf496bc)
Solutions
- Populate _settings.ValidationPaths with one or more directory paths before running validation.
- If loading settings from an asset, verify the asset was saved with paths and reload it.
- Add a UI/code guard that requires at least one path before enabling the Validate button.
Example fix
// before
var settings = ScriptableObject.CreateInstance<CurrentProjectValidationSettings>();
var v = new CurrentProjectValidator(settings);
// after
settings.ValidationPaths = new List<string> { "Assets/MyContent" };
var v = new CurrentProjectValidator(settings); Defensive patterns
Strategy: validation
Validate before calling
if (settings.ValidationPaths == null || settings.ValidationPaths.Count == 0)
throw new Exception("Add at least one validation path"); Type guard
static bool HasValidationPaths(CurrentProjectValidationSettings s) =>
s != null && s.ValidationPaths != null && s.ValidationPaths.Count > 0; Try / catch
try { validator.ValidateSettings(); }
catch (Exception ex) when (ex.Message.Contains("validation paths", StringComparison.OrdinalIgnoreCase)) { ... } Prevention
- Populate ValidationPaths before constructing the validator.
- Guard the Validate UI button on a non-empty paths list.
When it happens
Trigger: Constructing CurrentProjectValidator with a CurrentProjectValidationSettings whose ValidationPaths collection is null or has zero entries, then invoking validation (which calls ValidateSettings).
Common situations: A settings asset was serialized with the paths field cleared, or a script created the settings object without populating ValidationPaths. Common after resetting validation settings or loading a stale asset.
Related errors
- The following directories do not exist:
- Package was not found
- Path does not correspond to a valid package
- Source directory not found: {dir.FullName}
- Could not find external project's validation results
AI-assisted analysis of CoplayDev/unity-mcp@c21bf496bc (2026-08-13).
Data as JSON: /api/errors/a689fd420b8841f5.
Report an issue: GitHub.