2012-09-12 4 views
6

기본의 AssemblyInfo.cs은 다음과 같습니다 AssemblyInfo.cs에 필요한 것은 무엇입니까?

using System.Reflection; 
using System.Runtime.CompilerServices; 
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("Foobar")] 
[assembly: AssemblyDescription("")] 
[assembly: AssemblyConfiguration("")] 
[assembly: AssemblyCompany("")] 
[assembly: AssemblyProduct("Foobar")] 
[assembly: AssemblyCopyright("Copyright © 2012")] 
[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)] 

// The following GUID is for the ID of the typelib if this project is exposed to COM 
[assembly: Guid("e8cd5d7d-5fba-4fe1-a753-f0cc6e052bf2")] 

// 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")] 

무엇이 모든

정말 필요한가? 예를 들어 Guid 및 ComVisible을 필요 없으면 제거하거나 AssemblyTrademark를 그냥 비워 둘 수 있습니까?

+1

시도했을 때 어떤 일이 발생 했습니까? –

+3

글쎄, 그것은 충돌하지 않았지만, 내가 알지 못했던 어떤 더 큰 영향이 있는지, 궁금해했다. 어떤 상황이나 어떤 상황에서도 어셈블리를 사용할 수없는 것처럼 느껴진다. – Svish

+0

내가 생각할 수있는 유일한 문제는 여러 복사본을 넣는 것이다. GAC 어셈블리의 여러 버전의 어셈블리를 배치 할 수 있습니다. 각 사본마다 다른 문화권이있는 경우 동일한 버전의 사본을 여러 개 가질 수 있습니다. 그러나 버전 정보가 누락 된 경우 문제가 될 수 있습니다. –

답변

9

이것은 단지 메타 데이터 일 뿐이며 이 필요하지 않습니다.을 그대로 사용하십시오.

ComVisibleGuid은 어셈블리와 COM interop을 수행하는 경우에만 필요합니다. 다른 속성은 DLL에서 메타 데이터로 끝납니다 (Windows 탐색기의 파일 속성 대화 상자에서 Version 탭을 통해 볼 수 있음).

파일을 삭제할 수 있습니다. 메타 데이터가없고 COM으로 표시되지는 않지만 애플리케이션은 올바르게 컴파일됩니다.

3

정말 필수 속성 중 하나가 아닙니다. 그러나 그것을 사용하는 것이 좋습니다!

[assembly: AssemblyVersion("1.0.0.0")] 

AssemblyVersion은 어셈블리에 버전을 제공하며 CLR에서 어셈블리 (StrongName)를 식별하는 데 사용됩니다. AssemblyFileVersion은 FileDialog의 속성 일뿐입니다.

[assembly: AssemblyInformationalVersion("1.0.0.0")] 

다른 버전 정보도 있습니다. 또 다른 정말 좋은 속성은 다음과 같다 :

[assembly: SuppressIldasm] 

그것은 IL-코드를보고 ILDASM에서 어셈블리를 엽니 억제가 있습니다.

어셈블리 특성에 대해 더 많은 내용이 있습니다. 더 많은 정보를 얻기 위해 MSDN을 살펴 보시기 바랍니다.

+4

'SuppressIldasmAttribute'는 어셈블리에 IL을 출력하지 않도록 "ildasm.exe"에게 묻습니다. * 어떤 식 으로든 * 귀하의 코드를 보호하지 않습니다. – tomfanning

+0

당신은 옳습니다. 그러나 일리노이를 스파이하는 방법에 대한 큰 지식이없는 사람에게는 그만 둘 것입니다. –

+0

리플 렉터 나 ILSpy를 시작하는 데는 큰 지식이 필요하지 않습니다. – tomfanning

관련 문제