Что касается вашего # 1, вы можете редактировать элементы шаблона проекта, используя инструкции здесь или здесь . Я сделал это для VS 2K8, чтобы по умолчанию сделать StyleCop и FxCop счастливыми, но я не удосужился сделать это в 2010 году, поскольку я нахожу процедуру немного утомительной, и всегда есть вероятность, что пакет обновления VS может их перезаписать .
Например, я отредактировал файл program.cs в шаблоне ConsoleApplication так, чтобы он выглядел следующим образом:
// <copyright file="Program.cs" company="$registeredorganization$">
// Copyright (c) $year$ All Rights Reserved
// </copyright>
// <author></author>
// <email></email>
// <date>$time$</date>
// <summary></summary>
namespace $safeprojectname$
{
using System;
using System.Collections.Generic;
$if$ ($targetframeworkversion$ == 3.5)using System.Linq;
$endif$using System.Text;
/// <summary>
/// Contains the program's entry point.
/// </summary>
internal static class Program
{
/// <summary>
/// The program's entry point.
/// </summary>
/// <param name="args">The command-line arguments.</param>
private static void Main(string[] args)
{
}
}
}
и сборкаinfo.cs, чтобы выглядеть так:
// <copyright file="AssemblyInfo.cs" company="$registeredorganization$">
// Copyright (c) $year$ All Rights Reserved
// </copyright>
// <author></author>
// <email></email>
// <date>$time$</date>
// <summary></summary>
using System;
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("$projectname$")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("$registeredorganization$")]
[assembly: AssemblyProduct("$projectname$")]
[assembly: AssemblyCopyright("Copyright © $registeredorganization$ $year$")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
[assembly: CLSCompliant(true)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("$guid1$")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Я отправил инцидент в Microsoft Connect о том, что автоматически сгенерированный код их инструментов должен соответствовать StyleCop / FxCop и их руководствам по кодированию.