Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug launch fails on Windows with error 0x800700c1 if a file named dotnet is present #5083

Closed
anjan-rsi opened this issue Feb 28, 2022 · 9 comments

Comments

@anjan-rsi
Copy link

anjan-rsi commented Feb 28, 2022

Environment data

dotnet --info output:
.NET SDK (reflecting any global.json):
Version: 6.0.100
Commit: 9e8b04bbff

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19043
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.100\

Host (useful for support):
Version: 6.0.0
Commit: 4822e3c3aa

.NET SDKs installed:
6.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

VS Code version:
C# Extension version:
v1.24.0

OmniSharp log

Starting OmniSharp server at 2/28/2022, 12:04:05 PM
Target: c:\Users\Anjan Reddy\source\repos\rsi-core\Rsi.sln

OmniSharp server started with .NET 6.0.100
.
Path: c:\Users\Anjan Reddy.vscode\extensions\ms-dotnettools.csharp-1.24.0.omnisharp\1.38.0-net6.0\OmniSharp.dll
PID: 3004

Starting OmniSharp on Windows 10.0.19043.0 (x64)
info: OmniSharp.Services.DotNetCliService
Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
info: OmniSharp.Services.DotNetCliService
Using the 'dotnet' on the PATH.
info: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: .NET Core SDK 6.0.100 17.0.0 - "C:\Program Files\dotnet\sdk\6.0.100"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: .NET Core SDK 6.0.100 17.0.0 - "C:\Program Files\dotnet\sdk\6.0.100"
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionOptionsProvider, Order: 0
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
info: OmniSharp.MSBuild.ProjectSystem
Detecting projects in 'c:\Users\Anjan Reddy\source\repos\rsi-core\Rsi.sln'.
info: OmniSharp.MSBuild.ProjectManager
Queue project update for 'c:\Users\Anjan Reddy\source\repos\rsi-core\src\Rsi.Api\Rsi.Api.csproj'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for 'c:\Users\Anjan Reddy\source\repos\rsi-core\src\Rsi.Core\Rsi.Core.csproj'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for 'c:\Users\Anjan Reddy\source\repos\rsi-core\src\Rsi.DataAccess.EFCore\Rsi.DataAccess.EFCore.csproj'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for 'c:\Users\Anjan Reddy\source\repos\rsi-core\tests\Rsi.Fixtures\Rsi.Fixtures.csproj'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for 'c:\Users\Anjan Reddy\source\repos\rsi-core\tests\Rsi.UnitTests\Rsi.UnitTests.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'c:\Users\Anjan Reddy\source\repos\rsi-core'.
info: OmniSharp.Script.ScriptProjectSystem
Did not find any CSX files
info: OmniSharp.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location 'c:\Users\Anjan Reddy\source\repos\rsi-core' on host 15080.
info: OmniSharp.MSBuild.ProjectManager
Loading project: c:\Users\Anjan Reddy\source\repos\rsi-core\src\Rsi.Api\Rsi.Api.csproj
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file 'c:\Users\Anjan Reddy\source\repos\rsi-core\src\Rsi.Api\Rsi.Api.csproj'.
info: OmniSharp.MSBuild.ProjectManager
Adding project 'c:\Users\Anjan Reddy\source\repos\rsi-core\src\Rsi.Api\Rsi.Api.csproj'
info: OmniSharp.MSBuild.ProjectManager
Loading project: c:\Users\Anjan Reddy\source\repos\rsi-core\src\Rsi.Core\Rsi.Core.csproj
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file 'c:\Users\Anjan Reddy\source\repos\rsi-core\src\Rsi.Core\Rsi.Core.csproj'.
info: OmniSharp.MSBuild.ProjectManager
Adding project 'c:\Users\Anjan Reddy\source\repos\rsi-core\src\Rsi.Core\Rsi.Core.csproj'
info: OmniSharp.MSBuild.ProjectManager
Loading project: c:\Users\Anjan Reddy\source\repos\rsi-core\src\Rsi.DataAccess.EFCore\Rsi.DataAccess.EFCore.csproj
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file 'c:\Users\Anjan Reddy\source\repos\rsi-core\src\Rsi.DataAccess.EFCore\Rsi.DataAccess.EFCore.csproj'.
info: OmniSharp.MSBuild.ProjectManager
Adding project 'c:\Users\Anjan Reddy\source\repos\rsi-core\src\Rsi.DataAccess.EFCore\Rsi.DataAccess.EFCore.csproj'
info: OmniSharp.MSBuild.ProjectManager
Loading project: c:\Users\Anjan Reddy\source\repos\rsi-core\tests\Rsi.Fixtures\Rsi.Fixtures.csproj
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file 'c:\Users\Anjan Reddy\source\repos\rsi-core\tests\Rsi.Fixtures\Rsi.Fixtures.csproj'.
info: OmniSharp.MSBuild.ProjectManager
Adding project 'c:\Users\Anjan Reddy\source\repos\rsi-core\tests\Rsi.Fixtures\Rsi.Fixtures.csproj'
info: OmniSharp.MSBuild.ProjectManager
Loading project: c:\Users\Anjan Reddy\source\repos\rsi-core\tests\Rsi.UnitTests\Rsi.UnitTests.csproj
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file 'c:\Users\Anjan Reddy\source\repos\rsi-core\tests\Rsi.UnitTests\Rsi.UnitTests.csproj'.
info: OmniSharp.MSBuild.ProjectManager
Adding project 'c:\Users\Anjan Reddy\source\repos\rsi-core\tests\Rsi.UnitTests\Rsi.UnitTests.csproj'
info: OmniSharp.MSBuild.ProjectManager
Update project: Rsi.Api
info: OmniSharp.MSBuild.ProjectManager
Update project: Rsi.Core
info: OmniSharp.MSBuild.ProjectManager
Update project: Rsi.DataAccess.EFCore
info: OmniSharp.MSBuild.ProjectManager
Update project: Rsi.Fixtures
info: OmniSharp.MSBuild.ProjectManager
Update project: Rsi.UnitTests
Received response for /v2/getcodeactions but could not find request.

Steps to reproduce

  1. Navigate to "Run and Debug" in Visual Studio Code
  2. Add a launch.json that comes by default with Visual Studio Code
  3. Hit F5 or Start Debugging by pressing the Green Arrow.
  4. You will see that the project will start building, but will error out without starting the Debugger -
    Error processing 'configurationDone' request. Unknown Error: 0x800700c1

OmniSharpError_0x800700c1

Expected behavior

Debugger should start and one should be able to setup break points and debug an application

Actual behavior

Error processing 'configurationDone' request. Unknown Error: 0x800700c1

@gregg-miskelly
Copy link
Contributor

That error code is HRESULT_FROM_WIN32(ERROR_BAD_EXE_FORMAT) which is the error we will get if we either:

  1. Try to run an exe/dll which isn't actually an exe/dll
    -or-
  2. Try to run something of the wrong CPU architecture

First question: what is your program value in launch.json?

@anjan-rsi
Copy link
Author

"program": "${workspaceFolder}/src/Rsi.Api/bin/Debug/net6.0/Rsi.Api.dll"

@gregg-miskelly
Copy link
Contributor

I played around with this a whole bunch, and I have one guess. Do you have a file named dotnet in the root of your project (or whatever directory cwd is pointed at)?

@anjan-rsi
Copy link
Author

Yes, i do see the file, dotnet at the path - C:\Users\Anjan Reddy\source\repos\rsi-core\src\Rsi.Api

@gregg-miskelly
Copy link
Contributor

Can you confirm that if you remove or rename it this issue is fixed?

@gregg-miskelly gregg-miskelly self-assigned this Mar 1, 2022
@gregg-miskelly gregg-miskelly changed the title Error processing 'configurationDone' request. Unknown Error: 0x800700c1 Debug launch fails on Windows with error 0x800700c1 if a file named dotnet is present Mar 1, 2022
@anjan-rsi
Copy link
Author

Thanks much, the debugger is now working fine after I removed the file named, dotnet.

@gregg-miskelly
Copy link
Contributor

Cool. I enhanced our error handling, and, on Windows, fixed the code to just look for dotnet.exe instead of dotnet.

@anjan-rsi
Copy link
Author

I am curious as to how that file was created?

@gregg-miskelly
Copy link
Contributor

I am not aware of anything in .NET Tooling that will create that file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants