Home > Back-end >  VS Code - Error check missing in some projects
VS Code - Error check missing in some projects

Time:09-23

I made a new solution in .NET with a class library (dotnet new classlib) and an XUnit test project (dotnet new xunit). I then added a reference to the class library, from the test project (dotnet add <test-project> reference <class-library>).

Now I have live error checking (syntax highlighting) in the class library, but no in the test project. You can see an example below, where the class Foo doesn't exist anywhere, but doesn't generate a live warning in the unit test project (it still fails on build).

This is a VS Code issue only. If I open it in Visual Studio 2022, it works just fine.

What's going on here?

Screenshot from VS Code

CodePudding user response:

was been worng method publice class in method impliment

class method in not accpcet css file

All test classes are public All test classes are having the [TestClass] attribute declared All test methods are using the [TestMethod] attribute Both the productivity code and the test projects are targeting .NET 3.5. I have already tried to clean build my solution, and / or delete all obj, bin, Debug and Release folders I'd appreciate any hints which would explain this behaviour.

CodePudding user response:

Thanks to Restart OmniSharp from the command palette in VS Code.

  • Related