private static string TryGetVsProjectId(DeploymentContext context)
{
try
{
// Read web.config
string webConfigPath = Path.Combine(context.OutputPath, "web.config");
if (File.Exists(webConfigPath))
{
using (var stream = File.OpenRead(webConfigPath))
{
Guid? projectId = ProjectGuidParser.GetProjectGuidFromWebConfig(stream);
return projectId.HasValue ? projectId.Value.ToString() : null;
}
}
}
catch (Exception ex)
{
context.Tracer.TraceError(ex);
}
return null;
}