आपके # 1 के संबंध में, आप निर्देश here या here का उपयोग करके प्रोजेक्ट टेम्पलेट आइटम संपादित कर सकते हैं। मैंने इसे स्टाइलकॉप और FxCop को डिफ़ॉल्ट रूप से खुश करने के लिए VS 2K8 के लिए किया है, लेकिन मुझे 2010 के लिए ऐसा करने के लिए नहीं मिला है क्योंकि मुझे प्रक्रिया थोड़ा मुश्किल लगती है और हमेशा एक संभावना है कि वीएस सर्विस पैक उन्हें ओवरराइट कर सकता है ।
उदाहरण के लिए, मैं ConsoleApplication टेम्पलेट में Program.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")]
मैं प्रस्तुत किया है:
// <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)
{
}
}
}
और AssemblyInfo.cs इस तरह देखने के लिए माइक्रोसॉफ्ट कनेक्ट पर an incident इस प्रभाव से कि उनके टूल्स के ऑटो-जेनरेट कोड को स्टाइलकॉप/एफएक्सकॉप और उनके कोडिंग दिशानिर्देश दस्तावेजों को पूरा करना चाहिए।
स्रोत
2010-05-20 16:24:54
ध्यान रखें कि एमएस भी नोट करता है कि आपको सभी नियमों का पालन नहीं करना है और वे स्वयं नहीं हैं (पुनः: # 1)। – user7116
एचएम ... तो वे अपने नियमों का उपयोग क्यों नहीं करते हैं? क्या यह परियोजना के आधार पर फैसला किया गया है? –