dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.4k stars 10k forks source link

Razor crashes on project open causing intellisense to not function #14333

Closed mjnorman closed 5 years ago

mjnorman commented 5 years ago

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 () 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. (/Users/anonymous/.vscode/extensions/ms-vscode.csharp-1.21.1/dist/extension.js:80:165683) at Generator.next () at module.exports.r (/Users/anonymous/.vscode/extensions/ms-vscode.csharp-1.21.1/dist/extension.js:80:164457) at new Promise () 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

```Razor Non Razor file as active document ```

Projected CSharp document:

Expand

```C# Could not determine CSharp content ```

Projected Html document:

Expand

```Html 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|;

NTaylorMullen commented 5 years ago

@mjnorman are you still seeing this issue?

mjnorman commented 5 years ago

@NTaylorMullen Yes. It is very aggravating. The good news is that if I just walk away, it does eventually clear itself, although if I'm actively trying to code and it is occurring, it is very difficult to get anything done.

mjnorman commented 5 years ago

Another error that I've seen regularly is the below. Not sure if related or not, but it is in regards to the same project.razor.json file. I have one of these for each of the projects in this app --

Cannot read property '0' of undefined
Stack Trace:
TypeError: Cannot read property '0' of undefined
    at Function.file (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:124:488)
    at module.exports.t.RazorProjectManager.getProjectConfiguration (/Users/anonymous/.vscode/extensions/ms-vscode.csharp-1.21.3/dist/extension.js:80:167257)
    at module.exports.t.RazorProjectManager.updateProjectConfiguration (/Users/anonymous/.vscode/extensions/ms-vscode.csharp-1.21.3/dist/extension.js:80:165797)
    at module.exports.t.RazorProjectManager.<anonymous> (/Users/anonymous/.vscode/extensions/ms-vscode.csharp-1.21.3/dist/extension.js:80:165129)
    at Generator.next (<anonymous>:null:null)
    at s (/Users/anonymous/.vscode/extensions/ms-vscode.csharp-1.21.3/dist/extension.js:80:164290)
NTaylorMullen commented 5 years ago

Ah interesting, would it be possible for you to isolate which project is resulting in the Cannot read property '0' of undefined? Once isolated could you provide the project.razor.json? causing the problem?

mjnorman commented 5 years ago

I have that error for all 9 projects in this particular app. They are all similar to the below,

Example--

{
  "ProjectFilePath": "/Users/anonymous/code/iis/project/project.Scheduler/project.Scheduler.csproj",
  "TargetFramework": "netcoreapp2.2",
  "TagHelpers": [],
  "Configuration": {
    "ConfigurationName": "UnsupportedRazor",
    "LanguageVersion": "1.0",
    "Extensions": [
      {
        "ExtensionName": "UnsupportedRazorExtension"
      }
    ]
  }
}
NTaylorMullen commented 5 years ago

Oh very interesting.

Would you mind providing the following:

mjnorman commented 5 years ago

Yes unfortunately I'm not able to share a live repro of this project due to privacy. I did confirm that when I create a new project with dotnet new mvc and open in vscode, the project.razor.json is normal. This project is rather old. I wonder if it would be worth to create new projects with 2.2 and copy the code files in. Thoughts?

NTaylorMullen commented 5 years ago

Yes unfortunately I'm not able to share a live repro of this project due to privacy. I did confirm that when I create a new project with dotnet new mvc and open in vscode, the project.razor.json is normal. This project is rather old. I wonder if it would be worth to create new projects with 2.2 and copy the code files in. Thoughts?

That could definitely help. Depending on how old the project is it could definitely be hitting the limitations of Razor.VSCode's tooling support 😄

mjnorman commented 5 years ago

Is there a way to somehow refresh or rebuild those projects without having to recreate everything? I've always followed the upgrade steps for bringing a project to the new dotnet core version (csproj package upgrades etc), but not sure what upgrades Razor.VSCode would require?

NTaylorMullen commented 5 years ago

Razor.VSCode shouldn't require anything special. Basically if you're following the upgrade steps per-release/it works in VS/command line it should work for Razor.VSCode 😄

mjnorman commented 5 years ago

Ok so maybe I am confused about your previous statement

Depending on how old the project is it could definitely be hitting the limitations of Razor.VSCode's tooling support

Can you elaborate?

NTaylorMullen commented 5 years ago

Can you elaborate?

If your project is non-.NET Core or a .NET Core project.json 1.0 project then Razor.VSCode will not work

mjnorman commented 5 years ago

Ok it is definitely dotnet core, netcoreapp2.2, and in csproj not project.json format. What else can I look for in the project that might trigger this behavior?

NTaylorMullen commented 5 years ago

Ok it is definitely dotnet core, netcoreapp2.2, and in csproj not project.json format. What else can I look for in the project that might trigger this behavior?

Well, this is the magic that determines if a project is "unsupported". Do you happen to have a reference to System.Web.Razor.dll directly or indirectly?

mjnorman commented 5 years ago

Not that I know of, here is the root project csproj if that helps, just redacted the paths and project names. All of the sub project csproj are all similiar, just different packages being referenced and Microsoft.NET.Sdk vs Microsoft.NET.Sdk.Web.

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <Configurations>Debug;Release;test</Configurations>
  </PropertyGroup>

  <PropertyGroup>
    <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
    <EnableDefaultRazorTargetAssemblyInfoAttributes>false</EnableDefaultRazorTargetAssemblyInfoAttributes>
  </PropertyGroup>

  <ItemGroup>
    <_ContentIncludedByDefault Remove="wwwroot\css\site.min.css" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" />
    <PackageReference Include="Serilog.AspNetCore" Version="2.1.1" />
    <PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
    <PackageReference Include="Serilog.Sinks.Seq" Version="4.0.0" />
    <PackageReference Include="Serilog.Sinks.Debug" Version="1.0.1" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
    <PackageReference Include="System.Runtime.Serialization.Formatters" Version="4.3.0" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include=".......csproj" />
    <ProjectReference Include=".......csproj" />
    <ProjectReference Include=".......csproj" />
    <ProjectReference Include="........csproj" />
    <ProjectReference Include="........csproj" />
    <ProjectReference Include="........csproj" />
  </ItemGroup>

</Project>
NTaylorMullen commented 5 years ago

Just tried out a shell-like project based on what you posted and all works. Makes me believe that one of your ProjectReferences has a reference to System.Web.Razor.dll. Best way to check to see which one has the dependency indirectly is to open each projects obj/project.assets.json file and do a search for System.Web.Razor. That should allow you to find the culprit.

mjnorman commented 5 years ago

Checked each file and no hits :(

NTaylorMullen commented 5 years ago

Checked each file and no hits :(

Hmm, I wonder if it's not regenerating. If you delete the project.razor.json file, re-open in VSCode does the project.razor.json file get re-created?

mjnorman commented 5 years ago

well well. I deleted the main project obj long ago when this started happening, and never really considered it could be one of the sub projects. So I went in and deleted all obj folders from all projects, let it rebuild and restore, and the project.assets.json looks fine as rain. Maybe a use case for overwriting that file if exists or some variation? Not sure of downstream impacts, but it sure would have solved this issue.

NTaylorMullen commented 5 years ago

well well. I deleted the main project obj long ago when this started happening, and never really considered it could be one of the sub projects. So I went in and deleted all obj folders from all projects, let it rebuild and restore, and the project.assets.json looks fine as rain. Maybe a use case for overwriting that file if exists or some variation? Not sure of downstream impacts, but it sure would have solved this issue.

Hah, sounds like MSBuild was in a funky state where it "partially" restored but things were broken. So I take it everything is working now?

mjnorman commented 5 years ago

Let me hang on to the issue for a while. I want to keep my eye on the omni sharp log. I'll close in a few days if I see no reoccurence. Really appreciate your help.

NTaylorMullen commented 5 years ago

kk cool sounds good

mjnorman commented 5 years ago

Looks clean so far, thanks again.