microsoft/aspire · error · InvalidOperationException
Submitted files for input
Error message
Submitted files for input '{inputName}' do not match the completed uploads. What it means
When the dashboard marks uploaded files as accepted for an interaction input, every submitted file ID must exist in the upload store for that interaction. A file ID that is unknown to the store means the submitted file set does not match what was actually uploaded, so validation fails.
Solutions
- Have the client re-upload the files and submit only the file IDs returned by the current upload flow
- Verify the interactionId matches the one under which the files were uploaded
- Clear client-side cached file references after each interaction completes
Defensive patterns
Strategy: validation
Validate before calling
// client-side: only submit IDs obtained from the upload API of the same interaction if (!uploadedIds.every(id => currentInteractionUploadIds.has(id))) await reuploadFiles();
Try / catch
try { await submitFiles(interactionId, inputName, fileIds); } catch (FileMismatchException) { await reuploadFiles(); } Prevention
- Clear cached file IDs after each interaction completes
- Never reuse file IDs across interactions or page loads
- Re-upload rather than resubmit when in doubt
When it happens
Trigger: Calling MarkFilesAccepted (via ResolveValidateAndMarkFiles from the dashboard submission path) with a fileIds list containing an ID that was never registered for that interactionId.
Common situations: Stale/duplicated client state resubmitting old file IDs, IDs from a different interaction, page refresh causing the client to resend identifiers whose store entries were cleared.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Error message cannot be null or empty.
- File ' ' exceeded the expected size of bytes.
- File input ' ' accepts at most .
- Interaction ' ' is not accepting file uploads.
- Interaction ' ' is not accepting file uploads for input ' '.
AI-assisted analysis of microsoft/aspire@25830f84bd (2026-09-16).
Data as JSON: /api/errors/927874992a418481.
Report an issue: GitHub.
Appendix: source
Thrown at src/Aspire.Hosting/Dashboard/InteractionFileUploadStore.cs:158
{
files.Add(new InteractionFileUpload(fileId, entry.OriginalFileName, entry.TempFile.Path));
}
}
}
return files;
}
/// <summary>
/// Marks validated uploads as accepted into the interaction result.
/// </summary>
public void MarkFilesAccepted(int interactionId, string inputName, IReadOnlyList<string> fileIds)
{
foreach (var fileId in fileIds)
{
if (!TryGetEntry(interactionId, fileId, out var entry))
{
throw CreateFileMismatchException(inputName);
}
lock (entry)
{
if (entry.State is not (FileEntryState.Uploaded or FileEntryState.Accepted) ||
!string.Equals(entry.InputName, inputName, StringComparisons.InteractionInputName))
{
throw CreateFileMismatchException(inputName);
}
entry.State = FileEntryState.Accepted;
}
}
}
/// <summary>
/// Removes a file entry and deletes the associated file on disk.
/// </summary>View on GitHub (pinned to 25830f84bd)