0
votes

I am currently having an issue with my Blazor pages.

After working on a project and closing Visual Studio 2019 Community, I get a namespace error on my pages.

Severity Code Description Project File Line Suppression State Error CS0234 The type or namespace name 'Linq' does not exist in the namespace 'MyProject.Pages.System' (are you missing an assembly reference?)

This is on a .razor component, but it does this on all the components in my project and only seems to happen when I close VS and open in again later.

My folder structure has subfolders in the pages folder: e.g. Pages -AccessMan -Users -UsersList.razor

I have tried:

  1. Close VS and reopen
  2. Clean, Build
  3. Clean, Rebuild
  4. Delete obj and bin folders and Clean, Build

I have all my namespaces in my _Imports.razor as nothing changed and it worked before I closed VS for the day.

Missing reference include

  1. Linq
  2. Collections
  3. Threading
  4. HttpClient
  5. Task
  6. DateTime

I have tried to add the required namespaces to imports. still not workiing.

Any ideas?

1

1 Answers

1
votes

You're using System as a namespace in your project, so it's conflicting with the Microsoft System namespace.

Simplest fix is use a different name, e.g. MyProjects.Pages.MySystem or something similar.