in SmvLibrary/Utility.cs [959:1001]
public static SMVCloudConfig GetSMVCloudConfig()
{
try
{
string cloudConfigXmlPath = Path.Combine(GetSmvVar("assemblyDir"), cloudConfigXmlFileName);
string contents = ReadFile(cloudConfigXmlPath);
if (!String.IsNullOrEmpty(contents))
{
bool isXMLValid = false;
string schemaPath = Path.Combine(GetSmvVar("assemblyDir"), cloudConfigXsdFileName);
using (StringReader configContent = new StringReader(contents))
{
isXMLValid = ValidateXmlFile(schemaPath, configContent);
}
if (!isXMLValid)
{
Log.LogFatalError("Could not load and validate XML file: " + GetSmvVar("configFilePath"));
return null;
}
XmlSerializer serializer = new XmlSerializer(typeof(SMVCloudConfig));
SMVCloudConfig config = null;
using (TextReader reader = new StringReader(contents))
{
config = (SMVCloudConfig)serializer.Deserialize(reader);
}
return config;
}
else
{
Log.LogFatalError("Could not load and validate XML file: " + GetSmvVar("configFilePath"));
return null;
}
}
catch (Exception)
{
Log.LogFatalError("Could not load and validate XML file: " + GetSmvVar("configFilePath"));
return null;
}
}