question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to open 'file.ext': File not found (file:///file.ext).

See original GitHub issue

Environment 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

  1. Create console app
  2. Leave some error in the code and try to debug
  3. Click on the error in Problems tab

image

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…

capture

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:8
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
sebastianulmcommented, Jan 8, 2019

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.

0reactions
djpnewtoncommented, Jun 21, 2019
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found