728x90
반응형
728x170
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
반응형
그리드형(광고전용)
'C# > WinForm' 카테고리의 다른 글
[C#/WINFORM/.NET6] FontFamily 클래스 : GenericMonospace 정적 속성을 사용해 고정 폭 폰트 만들기 (0) | 2022.07.04 |
---|---|
[C#/WINFORM/.NET6] Application 클래스 : ProductVersion 정적 속성을 사용해 프로그램 버전 구하기 (0) | 2022.06.21 |
[C#/WINFORM/.NET6] SoundPlayer 클래스 : PlaySync 메소드를 사용해 비프음 만들기 (0) | 2022.06.10 |
[C#/WINFORM] 저수준 키보드 후킹하기 (0) | 2022.05.25 |
[C#/WINFORM] 멀티미디어 타이머 사용하기 (0) | 2022.05.25 |
[C#/WINFORM] MessageBox 클래스 : Show 정적 메소드를 사용해 최상위 메시지 박스 표시하기 (0) | 2022.05.14 |
[C#/WINFORM] Screen 클래스 : FromHandle 정적 메소드를 사용해 폼 최대화시 윈도우 작업표시줄 가리지 않기 (0) | 2022.05.13 |
[C#/WINFORM] UserControl 클래스 : 대용량 이미지 갤러리 사용하기 (0) | 2022.05.12 |
[C#/WINFORM/.NET5] ImageAttributes 클래스 : 투명 비트맵 구하기 (0) | 2022.05.04 |
[C#/WINFORM] Panel 클래스 : 그라디언트 패널 만들기 (0) | 2022.05.02 |
댓글을 달아 주세요