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.

Razor crashes on project open causing intellisense to not function

See original GitHub issue

Is this a Bug or Feature request?:

Bug

Steps to reproduce

Razor crashes on project open. The error is (Error) Failed to read project config at location .... .

Description of the problem:

This prohibits intellisense completion (in cshmtl) for example, with @model MyModel, I type @Model. I should get my model members, but I don’t. I just see the general Classes available, not specific to this project.

However this problem seems to be, and I hate to say it …intermittent…

Additionally I see project errors that exist in the Create.cshtml__virtual.cs file for instance, but this file does not exist! Sometimes if I close out VSCODE and reopen these errors go away, sometimes they are much more persistent.

Logs

OmniSharp

Expand

Starting OmniSharp server at 8/29/2019, 8:42:31 AM
    Target: /Users/anonymous/code/iis/project-core/project1.sln

OmniSharp server started with Mono 5.18.1.
    Path: /Users/anonymous/.vscode/extensions/ms-vscode.csharp-1.21.1/.omnisharp/1.34.2/omnisharp/OmniSharp.exe
    PID: 58377

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on MacOS 10.14.6 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 2 MSBuild instance(s)
            1: Mono 16.0 - "/Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin"
            2: StandAlone 16.0 - "/Users/anonymous/.vscode/extensions/ms-vscode.csharp-1.21.1/.omnisharp/1.34.2/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Mono 16.0 - "/Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin"
            CscToolPath = /Users/anonymous/.vscode/extensions/ms-vscode.csharp-1.21.1/.omnisharp/1.34.2/omnisharp/.msbuild/Current/Bin/Roslyn
            CscToolExe = csc.exe
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in '/Users/anonymous/code/iis/project-core'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
        Detecting projects in '/Users/anonymous/code/iis/project-core/project1.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/anonymous/code/iis/project-core/project1/project1.Web.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/anonymous/code/iis/project-core/project2/project2.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/Users/anonymous/code/iis/project-core'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/anonymous/code/iis/project-core/project1/project1.Web.csproj
[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.EditorConfigWorkspaceOptionsProvider, Order: 200
[info]: OmniSharp.WorkspaceInitializer
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location '/Users/anonymous/code/iis/project-core' on host 58344.
[info]: OmniSharp.OmniSharpWorkspace
        Miscellaneous file: /Users/anonymous/code/iis/project-core/project1/Views/MOM/Create.cshtml__virtual.cs added to workspace
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/anonymous/code/iis/project-core/project1/project1.Web.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/anonymous/code/iis/project-core/project1/project1.Web.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/anonymous/code/iis/project-core/project2/project2.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/anonymous/code/iis/project-core/project2/project2.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/anonymous/code/iis/project-core/project2/project2.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: project1.Web
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/anonymous/code/iis/project-core/project2/bin/Debug/netcoreapp2.2/project2.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: project2
[info]: OmniSharp.Roslyn.CSharp.Services.Diagnostics.CSharpDiagnosticWorkerWithAnalyzers
        Solution initialized -> queue all documents for code analysis. Initial document count: 58.

Razor

Expand

[Client - 8:24:56 AM] -- Starting Issue Data Collection-- 
[Client - 8:24:57 AM] Updating the C# document for Razor file '/Users/anonymous/code/iis/project-core/project1/Views/_ViewImports.cshtml' (1)
[Client - 8:24:57 AM] Notifying document '/Users/anonymous/code/iis/project-core/project1/Views/_ViewImports.cshtml' changed 'csharpChanged'
[Client - 8:24:59 AM] Notifying project '/Users/anonymous/code/iis/project-core/project1/project1.Web.csproj' - 'changed'
[Client - 8:24:59 AM] Updating the C# document for Razor file '/Users/anonymous/code/iis/project-core/project1/Views/view1/Create.cshtml' (1)
[Client - 8:24:59 AM] Notifying document '/Users/anonymous/code/iis/project-core/project1/Views/view1/Create.cshtml' changed 'csharpChanged'
[Client - 8:24:59 AM] Updating the C# document for Razor file '/Users/anonymous/code/iis/project-core/project1/Views/_ViewImports.cshtml' (1)
[Client - 8:24:59 AM] Notifying document '/Users/anonymous/code/iis/project-core/project1/Views/_ViewImports.cshtml' changed 'csharpChanged'
[Client - 8:24:59 AM] Notifying project '/Users/anonymous/code/iis/project-core/project1/project1.Web.csproj' - 'changed'
[Client - 8:24:59 AM] Updating the C# document for Razor file '/Users/anonymous/code/iis/project-core/project1/Views/view1/Create.cshtml' (1)
[Client - 8:24:59 AM] Notifying document '/Users/anonymous/code/iis/project-core/project1/Views/view1/Create.cshtml' changed 'csharpChanged'
[Client - 8:24:59 AM] Notifying project '/Users/anonymous/code/iis/project-core/project1/project1.Web.csproj' - 'changed'
[Client - 8:24:59 AM] Updating the C# document for Razor file '/Users/anonymous/code/iis/project-core/project1/Views/view1/Create.cshtml' (1)
[Client - 8:24:59 AM] Notifying document '/Users/anonymous/code/iis/project-core/project1/Views/view1/Create.cshtml' changed 'csharpChanged'
[Client - 8:24:59 AM] Updating the C# document for Razor file '/Users/anonymous/code/iis/project-core/project1/Views/_ViewImports.cshtml' (1)
[Client - 8:24:59 AM] Notifying document '/Users/anonymous/code/iis/project-core/project1/Views/_ViewImports.cshtml' changed 'csharpChanged'
[Client - 8:24:59 AM] Updating the C# document for Razor file '/Users/anonymous/code/iis/project-core/project1/Views/view1/Create.cshtml' (1)
[Client - 8:24:59 AM] Notifying document '/Users/anonymous/code/iis/project-core/project1/Views/view1/Create.cshtml' changed 'csharpChanged'
[Client - 8:25:01 AM] Notifying project '/Users/anonymous/code/iis/project-core/project1/project1.Web.csproj' - 'changed'
[Client - 8:25:01 AM] Notifying project '/Users/anonymous/code/iis/project-core/project1/project1.Web.csproj' - 'changed'
[Client - 8:25:03 AM] Updating the C# document for Razor file '/Users/anonymous/code/iis/project-core/project1/Views/view1/Create.cshtml' (1)
[Client - 8:25:03 AM] Notifying document '/Users/anonymous/code/iis/project-core/project1/Views/view1/Create.cshtml' changed 'csharpChanged'
[Client - 8:25:03 AM] Updating the C# document for Razor file '/Users/anonymous/code/iis/project-core/project1/Views/_ViewImports.cshtml' (1)
[Client - 8:25:03 AM] Notifying document '/Users/anonymous/code/iis/project-core/project1/Views/_ViewImports.cshtml' changed 'csharpChanged'
[Client - 8:25:03 AM] (Error) Failed to read project config at location /Users/anonymous/code/iis/project-core/project1/obj/Debug/netcoreapp2.2/project.razor.json.
Unexpected end of JSON input
Stack Trace:
SyntaxError: Unexpected end of JSON input
	at JSON.parse (<anonymous>)
	at module.exports.t.RazorProjectManager.getProjectConfiguration (/Users/anonymous/.vscode/extensions/ms-vscode.csharp-1.21.1/dist/extension.js:80:167240)
	at module.exports.t.RazorProjectManager.updateProjectConfiguration (/Users/anonymous/.vscode/extensions/ms-vscode.csharp-1.21.1/dist/extension.js:80:165797)
	at module.exports.t.RazorProjectManager.<anonymous> (/Users/anonymous/.vscode/extensions/ms-vscode.csharp-1.21.1/dist/extension.js:80:165683)
	at Generator.next (<anonymous>)
	at module.exports.r (/Users/anonymous/.vscode/extensions/ms-vscode.csharp-1.21.1/dist/extension.js:80:164457)
	at new Promise (<anonymous>)
	at module.exports.r (/Users/anonymous/.vscode/extensions/ms-vscode.csharp-1.21.1/dist/extension.js:80:164234)
	at module.exports.t.RazorProjectManager.register.i.onDidChange.e (/Users/anonymous/.vscode/extensions/ms-vscode.csharp-1.21.1/dist/extension.js:80:165638)
	at u.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:50:207)
	at define.constructor.e (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:549:955)
	at u.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:50:207)
	at u.$onFileEvent (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:550:901)
	at d._doInvokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:668:1006)
	at d._invokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:668:698)
	at d._receiveRequest (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:667:346)
	at d._receiveOneMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:666:141)
	at define.constructor._protocol.onMessage.e (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:664:400)
	at u.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:50:207)
	at a (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:179:815)
	at e (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:179:861)
	at u.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:50:207)
	at n.constructor.e.onMessage.e (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:775:104)
	at u.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:50:207)
	at a (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:179:815)
	at e (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:179:861)
	at u.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:50:207)
	at y._receiveMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:188:834)
	at define.constructor._socketDisposables.push._socketReader.onMessage.e (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:186:116)
	at u.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:50:207)
	at f.acceptChunk (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:182:588)
	at define.constructor._register._socket.onData.e (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:181:919)
	at Socket.t (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:190:329)
	at Socket.emit (events.js:182:13)
	at addChunk (_stream_readable.js:283:12)
	at readableAddChunk (_stream_readable.js:264:11)
	at Socket.Readable.push (_stream_readable.js:219:10)
	at Pipe.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
[Client - 8:25:03 AM] Notifying project '/Users/anonymous/code/iis/project-core/project1/project1.Web.csproj' - 'changed'
[Client - 8:25:04 AM] Updating the C# document for Razor file '/Users/anonymous/code/iis/project-core/project1/Views/view1/Create.cshtml' (1)
[Client - 8:25:04 AM] Notifying document '/Users/anonymous/code/iis/project-core/project1/Views/view1/Create.cshtml' changed 'csharpChanged'
[Client - 8:25:04 AM] Updating the C# document for Razor file '/Users/anonymous/code/iis/project-core/project1/Views/_ViewImports.cshtml' (1)
[Client - 8:25:04 AM] Notifying document '/Users/anonymous/code/iis/project-core/project1/Views/_ViewImports.cshtml' changed 'csharpChanged'
[Client - 8:25:05 AM] Updating the C# document for Razor file '/Users/anonymous/code/iis/project-core/project1/Views/view1/Create.cshtml' (1)
[Client - 8:25:05 AM] Notifying document '/Users/anonymous/code/iis/project-core/project1/Views/view1/Create.cshtml' changed 'csharpChanged'
[Client - 8:25:05 AM] Updating the C# document for Razor file '/Users/anonymous/code/iis/project-core/project1/Views/_ViewImports.cshtml' (1)
[Client - 8:25:05 AM] Notifying document '/Users/anonymous/code/iis/project-core/project1/Views/_ViewImports.cshtml' changed 'csharpChanged'
[Client - 8:25:05 AM] Updating the C# document for Razor file '/Users/anonymous/code/iis/project-core/project1/Views/view1/Create.cshtml' (1)
[Client - 8:25:05 AM] Notifying document '/Users/anonymous/code/iis/project-core/project1/Views/view1/Create.cshtml' changed 'csharpChanged'
[Client - 8:25:05 AM] Updating the C# document for Razor file '/Users/anonymous/code/iis/project-core/project1/Views/_ViewImports.cshtml' (1)
[Client - 8:25:05 AM] Notifying document '/Users/anonymous/code/iis/project-core/project1/Views/_ViewImports.cshtml' changed 'csharpChanged'
[Client - 8:25:12 AM] -- Stopping Issue Data Collection-- 

Workspace information

Razor document:

Expand

Non Razor file as active document

Projected CSharp document:

Expand

Could not determine CSharp content

Projected Html document:

Expand

Could not determine Html content

Machine information

VSCode version: 1.37.1 Razor.VSCode version: 1.21.1

dotnet --info

Expand

.NET Core SDK (reflecting any global.json):
 Version:   2.2.301
 Commit:    70d6be0814

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.14
 OS Platform: Darwin
 RID:         osx.10.14-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.2.301/

Host (useful for support):
  Version: 2.2.6
  Commit:  7dac9b1b51

.NET Core SDKs installed:
  2.2.102 [/usr/local/share/dotnet/sdk]
  2.2.104 [/usr/local/share/dotnet/sdk]
  2.2.106 [/usr/local/share/dotnet/sdk]
  2.2.301 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.2.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.2.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.2.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

Extensions

Expand

Extension Author Version
csharp ms-vscode 1.21.1
debugger-for-chrome msjsdiag 4.11.7
gitflow vector-of-bool 1.2.1
gitlens eamodio 9.9.3
theme-dracula dracula-theme 2.18.0
vscode-concourse Pivotal 1.10.0
vscode-coverage-gutters ryanluker 2.4.0
vscode-taskexplorer spmeesseman 1.20.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:23 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
mjnormancommented, Sep 27, 2019

Looks clean so far, thanks again.

0reactions
NTaylorMullencommented, Sep 25, 2019

kk cool sounds good

Read more comments on GitHub >

github_iconTop Results From Across the Web

Double intellisense Popups when editing Razor
Edit razor, go to type <a href=, Quotes are added for me and a file intellisense pops up to pick a link to...
Read more >
How to fix Visual Studio 2022 17.5 Intellisense not working
This is a general problem that started with 17.5: intellisense, renaming, underlining all failing; GoToDeclaration etc all much slower.
Read more >
Visual Studio 2015 Crashing when opening old razor views
As of this morning, I've noticed that it only crashes when I try to open a razor view that wasn't created through Visual...
Read more >
Is it just me or Visual Studio 2019 throws exceptions ...
I have been working in .NET Framework 4.7.2 and 4.8 with C# and Razor in MVC 5 and I think it has crashed......
Read more >
How to fix Razer Synapse 3 when it crashes or fails to start
Run "Task Manager" if the issue persists. Go to “Services”. Check if the following services are running: Razer Central Service; Razer Synapse Service....
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