Unable to open 'file.ext': File not found (file:///file.ext).
See original GitHub issueEnvironment data
dotnet --info
output:
.NET Command Line Tools (2.1.300-preview1-008174)
Product Information:
Version: 2.1.300-preview1-008174
Commit SHA-1 hash: b8df89a54f
Runtime Environment:
OS Name: Windows
OS Version: 10.0.17134
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.300-preview1-008174\
Microsoft .NET Core Shared Framework Host
Version : 2.1.0-preview1-26216-03
Build : f2c3216183d20416568a4bbf5bb7d153e826f153
VS Code version:
Visual Studio Code
Version 1.23.1
Commit d0182c3417d225529c6d5ad24b7572815d0de9ac
Date 2018-05-10T17:11:17.614Z
Shell 1.7.12
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64
C# Extension version:
Steps to reproduce
- Create console app
- Leave some error in the code and try to debug
- Click on the error in
Problems
tab
Expected behavior
When I click on the error it should just take me to the error.
Actual behavior
VSCode complains that the file cannot be found, even though it clearly knows about the file since it notified me about the error…
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:7 (2 by maintainers)
Top Results From Across the Web
How do I open a file with the file extension “FILE?”
The .file file extension is a generic extension. This is assigned by Windows and other applications when the file is in an unknown...
Read more >How to fix 'Excel cannot open the file because ...
Here are the steps to fix 'Excel cannot open the file because the file format or extension is not valid' issue on any...
Read more >How To Open a File With No Extension
Find a Program for a File Extension. If your file does have an extension, but you still can't open it, it's because you...
Read more >Excel cannot be open the file 'filename.xlsx' because ...
xlsx' because the file format or file extension is not valid. Hi All,. I have a excel.xlsx file saved in my system which...
Read more >Error opening file in H5PY (File signature not found)
I guess you try to open hdf v. 4 file. HDF5 files have extension of hdf5 or h5 . – Serenity. Jul 19,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
tldr; This needs to be in your tasks.json as build parameter for msbuild: “/property:GenerateFullPaths=true”
Long story: This is the default tasks.json that is generated (at least for me)
{ "version": "2.0.0", "tasks": [ { "label": "build", "command": "dotnet", "type": "process", "args": [ "build", "${workspaceFolder}<yourproject>.csproj", ], "problemMatcher": "$msCompile" } ] }
By default msbuild only generates relative paths. That’s why you see the file:///project/file.cs not found error message. Omnisharp expects absolute paths (there is probably a reason for this silliness) So add “/property:GenerateFullPaths=true” as a parameter to dotnet build should fix that problem.
@morden2k have you tried the solution here: https://github.com/OmniSharp/omnisharp-vscode/issues/2374#issuecomment-452485460