serviceClass.ContainingNamespace can be an empty string (e.g., when the service type is in the global namespace), which would generate invalid code: namespace ;. Guard with !string.IsNullOrEmpty(...) here, and/or represent the global namespace as null when building ServiceClass.
if (!string.IsNullOrEmpty(serviceClass.ContainingNamespace))
Originally posted by @Copilot in #4289 (comment)
serviceClass.ContainingNamespacecan be an empty string (e.g., when the service type is in the global namespace), which would generate invalid code:namespace ;. Guard with!string.IsNullOrEmpty(...)here, and/or represent the global namespace asnullwhen buildingServiceClass.Originally posted by @Copilot in #4289 (comment)