Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataCollector check with only Uri in Runsettings #2177

Merged
Expand Up @@ -422,7 +422,11 @@ private void LoadAndInitialize(DataCollectorSettings dataCollectorSettings, stri
// Look up the extension and initialize it if one is found.
var extensionManager = this.DataCollectorExtensionManager;
var dataCollectorUri = string.Empty;
this.TryGetUriFromFriendlyName(dataCollectorSettings.FriendlyName, out dataCollectorUri);

if (!this.TryGetUriFromFriendlyName(dataCollectorSettings.FriendlyName, out dataCollectorUri))
hvinett marked this conversation as resolved.
Show resolved Hide resolved
{
dataCollectorUri = dataCollectorSettings.Uri.ToString();
}

DataCollector dataCollector = null;
if (!string.IsNullOrWhiteSpace(dataCollectorUri))
Expand Down
Expand Up @@ -28,7 +28,11 @@ internal static IDataCollectionLauncher GetDataCollectorLauncher(IProcessHelper
var dataCollectionRunSettings = XmlRunSettingsUtilities.GetDataCollectionRunSettings(settingsXml);
foreach (var dataCollectorSettings in dataCollectionRunSettings.DataCollectorSettingsList)
{
if (dataCollectorSettings.FriendlyName.ToLower().Equals("event log"))
if (dataCollectorSettings.FriendlyName!=null && dataCollectorSettings.FriendlyName.ToLower().Equals("event log"))
hvinett marked this conversation as resolved.
Show resolved Hide resolved
{
return new DefaultDataCollectionLauncher();
}
if(dataCollectorSettings.Uri!=null && dataCollectorSettings.Uri.ToString().ToLower().Equals(@"datacollector://Microsoft/EventLog/2.0"))
{
return new DefaultDataCollectionLauncher();
}
Expand Down
Expand Up @@ -201,12 +201,6 @@ internal static DataCollectorSettings FromXml(XmlReader reader)

}

if (string.IsNullOrWhiteSpace(settings.FriendlyName))
{
throw new SettingsException(
String.Format(CultureInfo.CurrentCulture, Resources.Resources.MissingDataCollectorAttributes, "FriendlyName"));
}

reader.Read();
if (!empty)
{
Expand Down