Error on all Program.cs files on eShopOnContainers, microsoft microsevice based implmentation

Viewed 114

Severity Code Description Project File Line Suppression State Error CS0260 Missing partial modifier on declaration of type 'Program'; another partial declaration of this type exists WebStatus D:\GitHub\eShopOnContainers\src\Web\WebStatus\Program.cs 123 Active

... (int httpPort, int grpcPort) GetDefinedPorts(IConfiguration config) { var grpcPort = config.GetValue("GRPC_PORT", 5001); var port = config.GetValue("PORT", 80); return (port, grpcPort); }

public class Program
{
    public static string Namespace = typeof(Startup).Namespace;
    public static string AppName 
        =Namespace.Substring(Namespace.LastIndexOf('.',Namespace.LastIndexOf('.') - 1) + 1);
}

this is the program found in Program.cs, look that it doesn't have a defined namespace, there are a bunch of functions defined as 'GetDefinedPorts'. I am following the Microsoft microservice implementation example https://github.com/dotnet-architecture/eShopOnContainers

1 Answers

This looks like a bug in Visual Studio 2022. It doesn't happen in 2019. They are also in the middle of converting the solution to dot net 6 so things may get a little more stable after that work is complete.

Related