© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
8 replies
ToastedTuna

MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1

I'm running this file
test.cs
test.cs
using the terminal but i keep getting the error
MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1
MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1


using System;

namespace FavoriteNumber
{
    class Program
    {
        static void Main(string[] args)
        {
            // Ask user for favorite number
            int favNumber;
            Console.Write("Enter your favorite number: ");

            // Turn the answer into an int
            favNumber = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine($"Your favorite number is {favNumber}!");
        }
    }
}
using System;

namespace FavoriteNumber
{
    class Program
    {
        static void Main(string[] args)
        {
            // Ask user for favorite number
            int favNumber;
            Console.Write("Enter your favorite number: ");

            // Turn the answer into an int
            favNumber = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine($"Your favorite number is {favNumber}!");
        }
    }
}
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ The project file could not be loaded. Data at the root level invalid
C#CC# / help
3y ago
Project.resources could not be found
C#CC# / help
2y ago
✅ Metadata file could not be found
C#CC# / help
3y ago
System.UriFormatException: 'Invalid URI: The hostname could not be parsed.'
C#CC# / help
3y ago