public static void CheckWrongAssemblyInfoContents()
{
if (Arguments.ProjectType == ProjectType.Azure)
return;
string[] lines = File.ReadAllLines(Paths.AssemblyInfoFile);
Dictionary<string, string> properties = PropertiesHelper.ParseFromAssemblyInfo(lines);
if (properties.ContainsKey("AssemblyCopyright"))
{
properties["AssemblyCopyright"] = properties["AssemblyCopyright"]
.Replace(
"Copyright © CNET Content Solutions 2010",
"Copyright © CNET Content Solutions 2011")
.Replace(
"Copyright © CNET Content Solutions 2011",
"Copyright © CNET Content Solutions 2012")
.Replace(
"Copyright © CNET Content Solutions 2012",
"Copyright © CNET Content Solutions 2013")
.Replace(
"Copyright © CNET Content Solutions 2013",
"Copyright © CNET Content Solutions 2014");
}
Dictionary<string, string> required = new Dictionary<string, string>();
Dictionary<string, string> allowed = new Dictionary<string, string>();
switch (Arguments.ProjectType)
{
case ProjectType.ClickOnce:
case ProjectType.SystemTool:
case ProjectType.WindowsService:
required.Add("AssemblyTitle", Arguments.FriendlyName);
required.Add("AssemblyProduct", Arguments.FriendlyName);
break;
default:
required.Add("AssemblyTitle", Arguments.AssemblyName);
required.Add("AssemblyProduct", Arguments.AssemblyName);
break;
}
required.Add("AssemblyDescription", String.Empty);
required.Add("AssemblyConfiguration", String.Empty);
required.Add("AssemblyCompany", "CNET Content Solutions");
required.Add("AssemblyCopyright", "Copyright © CNET Content Solutions 2014");
required.Add("AssemblyTrademark", String.Empty);
required.Add("AssemblyCulture", String.Empty);
required.Add("AssemblyVersion", Arguments.ExpectedVersion);
allowed.Add("AssemblyFileVersion", Arguments.ExpectedVersion);
allowed.Add("NeutralResourcesLanguage", "en");
allowed.Add("ComVisible", "false");
allowed.Add("Guid", null);
string description;
if (ValidationHelper.CheckProperties(
properties,
required,
allowed,
out description))
return;
RaiseError.WrongAssemblyInfoContents(description);
}