unoplatform/uno · error · InvalidOperationException
MSBuild property MSBuildProjectFullPath value {_projectFullP
Error message
MSBuild property MSBuildProjectFullPath value {_projectFullPath} is not valid What it means
BindableTypeProvidersGenerationTask reads the MSBuildProjectFullPath property to derive the project directory for output. Path.GetDirectoryName returns null only when the path is empty, a drive root, or otherwise has no directory component, which the generator treats as an invalid project path and throws InvalidOperationException. The generator only runs when validPlatform && !isDesignTime && isApplication && !disableBindableTypeProvidersGeneration.
Source
Thrown at src/SourceGenerators/Uno.UI.SourceGenerators/BindableTypeProviders/BindableTypeProvidersGenerationTask.cs:69
public string[] AnalyzerSuppressions { get; set; } = Array.Empty<string>();
internal void Generate(GeneratorExecutionContext context)
{
try
{
var validPlatform = PlatformHelper.IsValidPlatform(context);
var isDesignTime = DesignTimeHelper.IsDesignTime(context);
var isApplication = PlatformHelper.IsApplication(context);
_ = bool.TryParse(context.GetMSBuildPropertyValue("UnoDisableBindableTypeProvidersGeneration"), out var disableBindableTypeProvidersGeneration);
if (validPlatform && !isDesignTime && isApplication && !disableBindableTypeProvidersGeneration)
{
_cancellationToken = context.CancellationToken;
_projectFullPath = context.GetMSBuildPropertyValue("MSBuildProjectFullPath");
_projectDirectory = Path.GetDirectoryName(_projectFullPath)
?? throw new InvalidOperationException($"MSBuild property MSBuildProjectFullPath value {_projectFullPath} is not valid");
// Defaults to 'false'
_ = bool.TryParse(context.GetMSBuildPropertyValue("UnoXamlResourcesTrimming"), out _xamlResourcesTrimming);
_intermediateOutputPath = context.GetMSBuildPropertyValue("IntermediateOutputPath");
_intermediatePath = Path.Combine(
_projectDirectory,
_intermediateOutputPath
);
_assemblyName = context.GetMSBuildPropertyValue("AssemblyName");
_defaultNamespace = context.GetMSBuildPropertyValue("RootNamespace");
_dependencyPropertySymbol = context.Compilation.GetTypeByMetadataName(XamlConstants.Types.DependencyProperty);
_dependencyObjectSymbol = context.Compilation.GetTypeByMetadataName(XamlConstants.Types.DependencyObject);
_javaObjectSymbol = context.Compilation.GetTypeByMetadataName("Java.Lang.Object");
_nsObjectSymbol = context.Compilation.GetTypeByMetadataName("Foundation.NSObject");View on GitHub (pinned to 0418340488)
Solutions
- Confirm the build is invoked through MSBuild/dotnet so MSBuildProjectFullPath is populated.
- Inspect the .csproj for an empty/invalid <Project> path or a misconfigured SDK import.
- If you intentionally drive the generator headless, set the property explicitly: dotnet build -p:MSBuildProjectFullPath=/abs/path/to/Project.csproj.
Example fix
# before: property missing/unset dotnet build /some/dir # after: ensure MSBuildProjectFullPath resolves, or pass it explicitly dotnet build /abs/path/to/Project.csproj
Defensive patterns
Strategy: validation
Validate before calling
// Assert the MSBuild property resolves before invoking a build that activates this generator
var path = Environment.GetEnvironmentVariable("MSBuildProjectFullPath");
if (string.IsNullOrWhiteSpace(path) || System.IO.Path.GetDirectoryName(path) == null)
throw new InvalidOperationException("MSBuildProjectFullPath is not set/valid; build via dotnet/MSBuild."); Prevention
- Always build through dotnet/MSBuild so MSBuildProjectFullPath is populated.
- Avoid invoking Uno source generators from bare Roslyn drivers without seeding MSBuild properties.
When it happens
Trigger: MSBuildProjectFullPath is empty, whitespace, a bare root (e.g. '/'), or unset at the time the generator executes, while all four activation conditions are true.
Common situations: Building through a non-standard host or test harness that does not define MSBuildProjectFullPath; a corrupted/empty .csproj; invoking the generator outside a normal MSBuild build.
Related errors
- MSBuild property MSBuildProjectFullPath value {_projectFullP
- The configuration property must be provided
- The configuration property must be provided
- MSBuild property MSBuildProjectFullPath value {_projectFullP
- type
AI-assisted analysis of unoplatform/uno@0418340488 (2026-08-13).
Data as JSON: /api/errors/54028cddbc4d964e.
Report an issue: GitHub.