-
Notifications
You must be signed in to change notification settings - Fork 676
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
current document is outside of any project opened #7737
Comments
I deleted all vscode files, recreated them and it only found one project when there are two. I added the second to the workspace and it started working again. I saved as workspace and it broke again. |
Typically you will see this error if none of the projects in the opened solution contain the active file. @codebrane if you open the solution explorer (see image below), that will show you what projects the extension has loaded. If you already have a solution, you can add the project to it from the solution explorer (right click the sln, add existing project). If you do not have a solution, you can create one via the dotnet CLI and add all the projects you want to load to it. If you have multiple solution files, you can set the default via the VSCode setting |
The active file is in the 2nd project which is part of the solution. When I recreated the structure it started working again until I saved as workspace and it broke again with that error. I managed to get round the issue by manually adding the 2nd project to the solution explorer. VSCode hadn't added it despite it being added manually at creation:
and saving as workspace seemed to have somehow removed it from the solution explorer. |
I'm wondering if your workspace is configured to open a different solution by default (or uses an autogenerated one), and not the solution you added the project to. In your workspace settings, could you try setting |
@codebrane Was the folder already open in Code at the time that you ran |
Open workspace with two projects. Open any file in 2nd project and the error appears:
"current document is outside of any project opened"
Deleted sln and workspace files, recreated structure and error persists. IDE can no longer be used due to lack of IDE functionality in 2nd project.
.NET test explorer says "3 tests". Right click on any of them and "Go to test" and it fails with the error "Could not find test (no symbols found)"
Can run/debug the tests from the .NET explorer but the IDE itself doesn't work as there isn't any intellisense for any file in the 2nd project due to the main error.
intellisense and test debug/run don't work in second project because of this error.
VS Code version: Code 1.95.1 (65edc49, 2024-10-31T05:14:54.222Z)
OS version: Darwin x64 22.6.0
Modes:
System Info
Item | Value -- | -- CPUs | Intel(R) Core(TM) i5-7600K CPU @ 3.80GHz (4 x 3800) GPU Status | 2d_canvas: enabledcanvas_oop_rasterization: disabled_offdirect_rendering_display_compositor: disabled_off_okgpu_compositing: enabledmultiple_raster_threads: enabled_onopengl: enabled_onrasterization: enabledraw_draw: disabled_off_okskia_graphite: disabled_offvideo_decode: enabledvideo_encode: enabledwebgl: enabledwebgl2: enabledwebgpu: enabledwebnn: disabled_off Load (avg) | 2, 2, 3 Memory (System) | 8.00GB (0.04GB free) Process Argv | . --crash-reporter-id 634156d6-311a-462f-be77-c0a789a1101c Screen Reader | no VM | 0%(1 theme extensions excluded)
A/B Experiments
"current document is outside of any project opened"
Deleted sln and workspace files, recreated structure and error persists. IDE can no longer be used due to lack of IDE functionality in 2nd project.
intellisense and test debug/run don't work in second project because of this error.
VS Code version: Code 1.95.1 (microsoft/vscode@65edc49, 2024-10-31T05:14:54.222Z)
OS version: Darwin x64 22.6.0
Modes:
System Info
Item Value
CPUs Intel(R) Core(TM) i5-7600K CPU @ 3.80GHz (4 x 3800)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 2, 2, 3
Memory (System) 8.00GB (0.04GB free)
Process Argv . --crash-reporter-id 634156d6-311a-462f-be77-c0a789a1101c
Screen Reader no
VM 0%
Extensions (52)
Extension Author (truncated) Version
cucumberautocomplete ale 3.0.5
specflow-tools ami 1.1.3
azurite Azu 3.33.0
doxdocgen csc 1.4.0
cucumber-official Cuc 1.10.0
vscode-eslint dba 3.0.10
durablefunctionsmonitor Dur 6.5.1
vscode-html-css ecm 2.0.10
prettier-vscode esb 11.0.0
php-intellisense fel 2.3.14
dotnet-test-explorer for 0.7.8
better-cpp-syntax jef 1.27.1
rainbow-csv mec 3.12.0
azure-dev ms- 0.8.4
vscode-azureappservice ms- 0.25.4
vscode-azurecontainerapps ms- 0.7.1
vscode-azurefunctions ms- 1.15.4
vscode-azureresourcegroups ms- 0.9.8
vscode-azurestaticwebapps ms- 0.12.2
vscode-azurestorage ms- 0.16.1
vscode-azurevirtualmachines ms- 0.6.6
vscode-bicep ms- 0.30.23
vscode-cosmosdb ms- 0.23.0
vscode-docker ms- 1.29.3
vscode-logicapps ms- 1.2.9
csdevkit ms- 1.11.14
csharp ms- 2.54.20
dotnet-interactive-vscode ms- 1.0.5530010
vscode-dotnet-runtime ms- 2.2.2
vscodeintellicode-csharp ms- 2.1.11
semantic-kernel ms- 0.12.0
jupyter ms- 2024.10.0
jupyter-keymap ms- 1.1.2
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
remote-containers ms- 0.388.0
remote-ssh ms- 0.115.0
remote-ssh-edit ms- 0.87.0
remote-wsl ms- 0.88.5
vscode-remote-extensionpack ms- 0.26.0
azure-account ms- 0.12.0
azurecli ms- 0.6.0
cpptools ms- 1.22.10
cpptools-extension-pack ms- 1.3.0
powershell ms- 2024.2.2
remote-explorer ms- 0.4.3
remote-server ms- 1.5.2
vscode-node-azure-pack ms- 1.2.0
vscode-serial-monitor ms- 0.13.1
specflow-steps-definition-generator Raj 1.0.5
LiveServer rit 5.7.9
vscode-stylelint sty 1.4.0
(1 theme extensions excluded)
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
a9j8j154:30646983
962ge761:30959799
pythongtdpath:30769146
pythonnoceb:30805159
asynctok:30898717
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
01bff139:31013167
dvdeprecation:31068756
dwnewjupyter:31046869
impr_priority:31102340
nativerepl2:31139839
refactort:31108082
pythonrstrctxt:31112756
wkspc-onlycs-t:31132770
nativeloc2:31134642
wkspc-ranged-t:31151552
cf971741:31144450
iacca1:31171482
notype1cf:31157160
5fd0e150:31155592
dwcopilot:31170013
The text was updated successfully, but these errors were encountered: