What Caused An Unexpected Build Error in C# with Microsoft Code

6 days ago 8
ARTICLE AD BOX

This is a C# program, and I am using Microsoft Visual Studio Code. I have been able to build and run the program without any issue for a long time. Now, unexpectedly I get this error:

I:\source\megaSearch\tempCodeRunnerFile.cs(1,9): error CS1001: Identifier expected [i:\source\megaSearch\megaSearch.csproj] I:\source\megaSearch\tempCodeRunnerFile.cs(1,9): error CS1002: ; expected [i:\source\megaSearch\megaSearch.csproj]

So, it is in the project file but I have not edited the project file or opened it. Here is the project file:

<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net8.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> </PropertyGroup> </Project>

CS1001 is “Identifier expected” but I do not see how there is any missing bit of code in the line

So, I asked I have found the solution which I will post next and leave this post here for a next person.

xarzu's user avatar

Read Entire Article