Error running Azure Functions in Aspire from Visual Studio
Is there an existing issue for this?
- [x] I have searched the existing issues
Describe the bug
When running dotnet aspire with an azure function app. I frequently get this error. It seems to resolve with a reboot, but then happens again after an arbitrary period of time. It looks like a temp file is not being released after dotnet aspire is stopped.
Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0] run session could not be started: IDE returned a response indicating failure {"Executable": {"name":"Function-App-xxxxxxx"}, "Reconciliation": 27, "Status": "500 Internal Server Error", "Body": "The process cannot access the file 'C:\Users\********\AppData\Local\Temp\tmpXXXX.tmp' because it is being used by another process."}
Expected Behavior
The azure function project should start in dotnet aspire.
Steps To Reproduce
I get this frequently when debugging from visual studio.
Exceptions (if any)
Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0] run session could not be started: IDE returned a response indicating failure {"Executable": {"name":"Function-App-xxxxxxx"}, "Reconciliation": 27, "Status": "500 Internal Server Error", "Body": "The process cannot access the file 'C:\Users\********\AppData\Local\Temp\tmpXXXX.tmp' because it is being used by another process."}
.NET Version info
dotnet sdk 8.0.309
Anything else?
The file appears to be locked by dotnet.exe. However, when I inspect it using power toys file locksmith it indicates that it is not locked. However, I cannot delete the file.
@dorlandode Thanks for filing this issue!
Quick note: The Aspire + Azure Functions currently requires that you use a .NET 9 SDK.
Does this issue repro for you in both Visual Studio and the CLI?
Baed on the path, I suspect that this might be related to the temporary files that DCP uses for logging.
cc: @karolz-ms For any insights here.
@captainsafia this error comes from Visual Studio and indicates some problem with launching the function app. DCP delegates the function app launch to VS and just logs the response, including the error message; it is largely out of the picture in this scenario.
@LittleLittleCloud @JakeRadMSFT FYI
I have only experienced this from Visual Studio, never from the cli.
I use Version 17.14.0 Preview 4.0 and experience same issue
dotnet sdk 8.0.309
I noticed that you are using the 8.0 SDK here. Can you reproduce these issues with the .NET 9 SDK?
I do not use Azure functions, but error message appear very close to this one.
Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler: Error: run session could not be started: IDE returned a response indicating failure {"Executable": {"name":"admin-ptbzezev"}, "Reconciliation": 2, "Status": "500 Internal Server Error", "Body": "The method or operation is not implemented."}
global.json
{
"sdk": {
"version": "9.0.105",
"allowPrerelease": true,
"rollForward": "latestFeature"
}
}
dotnet --info
.NET SDKs installed:
6.0.428 [C:\Program Files\dotnet\sdk]
8.0.115 [C:\Program Files\dotnet\sdk]
8.0.408 [C:\Program Files\dotnet\sdk]
9.0.105 [C:\Program Files\dotnet\sdk]
9.0.300-preview.0.25177.5 [C:\Program Files\dotnet\sdk]
10.0.100-preview.3.25201.16 [C:\Program Files\dotnet\sdk]
Also experience this from IDE. After restart of IDE it works for some time. Maybe couple hours. or maybe 10 runs (that's approximate feelings, not hard numbers)
I have the same problem (with a ASP.NET Core WebAPI project, not Azure Functions):
fail: Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0]
run session could not be started: IDE returned a response indicating failure {"Executable": {"name":"My-Project-Name-rkhghavf"}, "Reconciliation": 4, "Status": "500 Internal Server Error", "Body": "The method or operation is not implemented."}
❯ dotnet --info
.NET SDK:
Version: 9.0.301
Commit: a596cd22e2
Workload version: 9.0.300-manifests.fc774770
MSBuild version: 17.14.5+edd3bbf37
Runtime Environment:
OS Name: Windows
OS Version: 10.0.26100
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.301\
Visual Studio 2022 Version 17.14.5.
This only seems to happen with "Debug" in Visual Studio, not with dotnet run at the CLI.
fail: Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0] run session could not be started: IDE returned a response indicating failure {"Executable": {"name":"My-Project-Name-rkhghavf"}, "Reconciliation": 4, "Status": "500 Internal Server Error", "Body": "The method or operation is not implemented."}
I am also seeing this issue debugging ASP.NET Core WebAPIs in VS (Version 17.14.5) (but it's fine with dotnet run). Same SDK version and similar runtime env
I (and several colleagues) also getting this same issue intermittently with VS for an App Host without any Azure Functions integration. It doesn't always happen, but once it does, you have to restart VS before the error goes away. It occurs both when starting the AppHost, but you can also re-trigger it if you try to manually start any of the resources in the FailedToStart sate.
I have captured a perfview trace of this I can share if it would help. Seems like the errors are coming from within the ServiceHub.Host.dotnet.x64 process. VS 17.14.0 for me, but my colleague has gotten this with 17.14.7
I'm getting a similar issue with AWS Lambda and some ASP.NET Core applications in Visual Studio 17.14.9:
fail: Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0]
run session could not be started: IDE returned a response indicating failure {"Executable": {"name":"Website-azfkegze"}, "Reconciliation": 2, "Status": "500 Internal Server Error", "Body": "The method or operation is not implemented."}
dotnet run is fine.
I am also seeing this on a .NET Core app in Visual Studio 17.14.9. Full clean and rebuild and same error. Restarting visual studio and ending a hung VBCSCompiler process resolved this for now for me.
Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0]
run session could not be started: IDE returned a response indicating failure {"Executable": {"name":"webfrontend-rxfhnwde"}, "Reconciliation": 7, "Status": "500 Internal Server Error", "Body": "The method or operation is not implemented."}
@JakeRadMSFT @LittleLittleCloud Did we end up making any progress here? The recent reports all seem to consistently identify the issue in VS 17.14.9.
Haven't have chance to look at it yet, will try to find out some time this week
I've seen two types of error under this thread
Method not implemented: {"Executable": {"name":"webfrontend-rxfhnwde"}, "Reconciliation": 7, "Status": "500 Internal Server Error", "Body": "The method or operation is not implemented."}
and
Process can't access file: "Executable": {"name":"Function-App-xxxxxxx"}, "Reconciliation": 27, "Status": "500 Internal Server Error", "Body": "The process cannot access the file 'C:\Users\********\AppData\Local\Temp\tmpXXXX.tmp' because it is being used by another process."}
And they are likely to be different bugs. I'll start with Method not implemented given this have more reporters.
Update
PR to address Method not implemented bug: https://devdiv.visualstudio.com/DevDiv/_git/WebTools/pullrequest/656707?_a=files
The cause of Method not implemented is because Aspire project system has two aspire server host
- VsAspireServerHost: A full function implementation of
IAspireServerHostfor ordinary use case - TestingAspireServerHost: A partial implementation of
IAspireServerHostfor unit testing
Both server host will register itself as IAspireServerHost to VsAspireServer when initialized, and they provide method implementation like LogAsync for VsAspireServer to callback. However, TestingAspireServerHost doesn't actually implements LogAsync and it just throw NotImplementation because logging aspire logs is not necessary in unit testing scenario. This causes the Method not implement error log when the TestingAspireServerHost is selected by VsAspireServer to log message.
The fix is in VsAspireServer, always selects the VsAspireServerHost to log a message
Update on 2025/08/18
The PR has been merged.
Happened for me locally as well on 9.4.1; Resolved by deleting bin/obj on apphost and apirservice projects and restarted VS.
@LittleLittleCloud can this be closd now?
The fix for "Status": "500 Internal Server Error", "Body": "The method or operation is not implemented." is out and should be available in Dev18 preview1.
@dorlandode Can you give your azure function app another tries to see if you still get 'C:\Users\********\AppData\Local\Temp\tmpXXXX.tmp' because it is being used by another process." error, please to reopen this issue if you hit that issue again.