2013-08-15 2 views
-2

C# Winform 응용 프로그램을 수행하고 있습니다. 여러 클래스 라이브러리가 있습니다. 각 도서관도 프로젝트입니다. 일반적으로, 아래 코드를 사용하여 응용 프로그램의 빌드 날짜를 알 수 있습니다. 그러나 각 클래스 라이브러리의 빌드 날짜를 알고 싶습니다. 어떤 도움 ...C# 클래스 라이브러리의 빌드 날짜를 알고있는 방법

DateTime buildDate = new 
     FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime; 
MessageBox.Show(string.Format("Build Date : {0}", buildDate), "Version Info"); 
+0

는 dublicate 질문을하기 전에 대답을 직접 검색하는 것이 좋습니다. http://stackoverflow.com/questions/2050396/getting-the-date-of-a-net-assembly – Drasive

+1

질문 : "모든 어셈블리 목록을 얻는 방법" 또는 "주어진 클래스가 정의 된 어셈블리를 얻는 방법"을 원하십니까? - 매우 명확하지 않습니다 ... –

+0

또는 "버전"어셈블리 특성을 재발견하려고합니까? –

답변

1

은 무엇 이것에 대해 업데이트?

System.IO.FileInfo fileInfo = new System.IO.FileInfo(Assembly.GetExecutingAssembly().Location); 
DateTime lastModified = fileInfo.LastWriteTime; 

또는 여기 대답에 설명 된대로 당신이 뭔가를 시도 할 수 : ASP.NET - show application build date/info at the bottom of the screen

+0

'file.CreationTime'은 잘못된 생각입니다. 파일 복사 만하면됩니다. – joe

+0

네, 맞습니다! – Marcus

1

가 공정 사용의 모든 어셈블리의 목록 (AppDomain.CurrentDomain)를 얻으려면 [http://msdn.microsoft.com/ en-us/library/system.appdomain.currentdomain.aspx]를 입력 한 다음 AppDomain.GetAssemblies을 입력하십시오. 목록으로

는 코드 (new FileInfo(assembly.Location).LastWriteTime;를 사용하거나 더 나은 아직 그 기사에서 샘플을 사용하여 AssemblyName.Version를 통해 Version를 얻을 :

Console.WriteLine("The version of the currently executing assembly is: {0}", 
     Assembly.GetExecutingAssembly().GetName().Version); 

    Console.WriteLine("The version of mscorlib.dll is: {0}", 
     typeof(String).Assembly.GetName().Version); 
관련 문제