in src/Tasks/GenerateManifestBase.cs [211:286]
private AssemblyIdentity CreateAssemblyIdentity(AssemblyIdentity baseIdentity, AssemblyIdentity entryPointIdentity)
{
string name = _assemblyName;
string version = _assemblyVersion;
string publicKeyToken = "0000000000000000";
string culture = _targetCulture;
if (String.IsNullOrEmpty(name))
{
if (baseIdentity != null && !String.IsNullOrEmpty(baseIdentity.Name))
name = baseIdentity.Name;
else if (entryPointIdentity != null && !String.IsNullOrEmpty(entryPointIdentity.Name))
{
if (_manifest is DeployManifest)
name = Path.GetFileNameWithoutExtension(entryPointIdentity.Name) + ".application";
else if (_manifest is ApplicationManifest)
name = entryPointIdentity.Name + ".exe";
}
}
if (String.IsNullOrEmpty(name))
{
Log.LogErrorWithCodeFromResources("GenerateManifest.NoIdentity");
return null;
}
if (String.IsNullOrEmpty(version))
{
if (baseIdentity != null && !String.IsNullOrEmpty(baseIdentity.Version))
version = baseIdentity.Version;
else if (entryPointIdentity != null && !String.IsNullOrEmpty(entryPointIdentity.Version))
version = entryPointIdentity.Version;
}
if (String.IsNullOrEmpty(version))
version = "1.0.0.0";
if (String.IsNullOrEmpty(culture))
{
if (baseIdentity != null && !String.IsNullOrEmpty(baseIdentity.Culture))
culture = baseIdentity.Culture;
else if (entryPointIdentity != null && !String.IsNullOrEmpty(entryPointIdentity.Culture))
culture = entryPointIdentity.Culture;
}
if (String.IsNullOrEmpty(culture)
|| String.Equals(culture, "neutral", StringComparison.OrdinalIgnoreCase)
|| String.Equals(culture, "*", StringComparison.OrdinalIgnoreCase))
culture = "neutral";
if (String.IsNullOrEmpty(_processorArchitecture))
{
if (baseIdentity != null && !String.IsNullOrEmpty(baseIdentity.ProcessorArchitecture))
_processorArchitecture = baseIdentity.ProcessorArchitecture;
else if (entryPointIdentity != null && !String.IsNullOrEmpty(entryPointIdentity.ProcessorArchitecture))
_processorArchitecture = entryPointIdentity.ProcessorArchitecture;
}
if (String.IsNullOrEmpty(_processorArchitecture))
_processorArchitecture = "msil";
// Fixup for non-ClickOnce case...
if (_manifest is ApplicationManifest)
{
ApplicationManifest applicationManifest = _manifest as ApplicationManifest;
if (!applicationManifest.IsClickOnceManifest)
{
// Don't need publicKeyToken attribute for non-ClickOnce case
publicKeyToken = null;
// Language attribute should be omitted if neutral
if (String.Compare(culture, "neutral", StringComparison.OrdinalIgnoreCase) == 0)
culture = null;
// WinXP loader doesn't understand "msil"
if (String.Compare(_processorArchitecture, "msil", StringComparison.OrdinalIgnoreCase) == 0)
_processorArchitecture = null;
}
}
return new AssemblyIdentity(name, version, publicKeyToken, culture, _processorArchitecture);
}