Port forward debugging
This commit is contained in:
@@ -380,17 +380,27 @@ public class VmManagementService
|
||||
try
|
||||
{
|
||||
var json = File.ReadAllText(configFile);
|
||||
Console.WriteLine($"Loading config from {configFile}");
|
||||
Console.WriteLine($"JSON content: {json}");
|
||||
|
||||
var config = JsonSerializer.Deserialize<VmConfiguration>(json);
|
||||
|
||||
if (config != null && !string.IsNullOrWhiteSpace(config.Name))
|
||||
{
|
||||
Console.WriteLine($"Successfully loaded VM: {config.Name}");
|
||||
Console.WriteLine($"Network interfaces count: {config.Network?.Interfaces?.Count ?? 0}");
|
||||
_vmConfigurations[config.Name] = config;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"Failed to deserialize config from {configFile}: config is null or has no name");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Log error but continue loading other configurations
|
||||
Console.WriteLine($"Failed to load configuration from {configFile}: {ex.Message}");
|
||||
Console.WriteLine($"Exception details: {ex}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user