void RemoveMSBuildProjectNameDerivedProperties(MSBuildPropertyGroup globalPropertyGroup) { string msbuildProjectName = globalPropertyGroup.ParentProject.FileName.FileNameWithoutExtension; if (!hasAssemblyName) { globalPropertyGroup.RemovePropertyIfHasDefaultValue("AssemblyName", msbuildProjectName); } if (!hasRootNamespace) { globalPropertyGroup.RemovePropertyIfHasDefaultValue("RootNamespace", msbuildProjectName); } }
static void RemoveOutputTypeIfHasDefaultValue(MSBuildProject project, MSBuildPropertyGroup globalPropertyGroup) { string outputType = project.EvaluatedProperties.GetValue("OutputType"); if (string.IsNullOrEmpty(outputType)) { globalPropertyGroup.RemoveProperty("OutputType"); } else { globalPropertyGroup.RemovePropertyIfHasDefaultValue("OutputType", outputType); } }