첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170

TestProject.zip
0.01MB

 

1. Properties/AssemblyInfo.cs 파일을 제거한다.

 

2. 아래와 같이 Assembly.tt 파일을 추가한다.

▶ Properties/Assembly.tt

<#@ template language="C#" hostspecific="true" #>
// 
// This code was generated by a tool. Any changes made manually will be lost
// the next time this code is regenerated.
// 

using System.Reflection;

[assembly: AssemblyVersion("<#= this.Revision1#>.<#= this.Revision2#>.<#= this.Revision3#>.<#= this.Revision4#>")]
[assembly: AssemblyFileVersion("<#= this.Revision1#>.<#= this.Revision2#>.<#= this.Revision3#>.<#= this.Revision4#>")]
<#+
    int Revision1 = DateTime.Now.Year ;

    int Revision2 = DateTime.Now.Month;
    int Revision3 = DateTime.Now.Day  ;
	int Revision4 = DateTime.Now.Hour*100 + DateTime.Now.Minute ;
#>

 

3. 프로젝트 속성의 [빌드 이벤트/빌드 이벤트 명령줄 대화 상자]에서 아래와 같이 코드를 추가한다.

if $(ConfigurationName) == Release "$(DevEnvDir)TextTransform.exe" -out "$(ProjectDir)Properties\Assembly.cs" "$(ProjectDir)Properties\Assembly.tt"

 

4. MainForm.cs 파일에서 아래와 같이 코드를 추가한다.

▶ MainForm.cs

using System;
using System.Windows.Forms;

namespace TestProject
{
    /// <summary>
    /// 프로그램
    /// </summary>
    static class Program
    {
        //////////////////////////////////////////////////////////////////////////////////////////////////// Method
        ////////////////////////////////////////////////////////////////////////////////////////// Static
        //////////////////////////////////////////////////////////////////////////////// Private

        #region 프로그램 시작하기 - Main()

        /// <summary>
        /// 프로그램 시작하기
        /// </summary>
        [STAThread]
        private static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm());
        }

        #endregion
    }
}
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요