IT정보공유/C#

어셈블리가 필수 구성 요소로 표시되려면 강력하게 서명되어야 합니다.

알지오™ 2020. 4. 8.

갑자기 정상적으로 컴파일 되던 소스가 컴파일이 안되고 이상한 오류메세지가 발생했습니다.
프로젝트에서 OCX 컨트롤을 사용하고 있는데 해당 OCX 컨트롤 관련 dll에서 발생하는 오류메세지.

어셈블리가 필수 구성 요소로 표시되려면 강력하게 서명되어야 합니다.


필수 구성요소? 강력한 서명? 이게 도대체 무슨말인가 싶어서
OCX 참조도 지우고, 다시 참조시켜보고
인터넷을 검색해도 별로 자료도 안나오더라고요.

그래서 svn을 이용해 어떤 부분이 다른가 소스를 일일이 비교하다가 원인을 찾았습니다.

C# Form 파일중에 폼디자인 관련 부분인 Form.Designer.cs 파일에 원인이 있었어요.

InitializeComponent() 함수안 1줄이 사라졌습니다.

 

designer.cs

 

Form designer.cs 소스 

private void InitializeComponent()
{
    //*********************
	
	this.components = new System.ComponentModel.Container(); // <-- 이놈이 범인
    
	//*********************
	
	System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain));
    this.splitContainerControl = new DevExpress.XtraEditors.SplitContainerControl();
    this.navBarControl = new DevExpress.XtraNavBar.NavBarControl();
    this.mailGroup = new DevExpress.XtraNavBar.NavBarGroup();
    this.navBarGroupControlContainer1 = new DevExpress.XtraNavBar.NavBarGroupControlContainer();
    this.trEquip = new DevExpress.XtraTreeList.TreeList();
    this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
    this.tsmiOpen = new System.Windows.Forms.ToolStripMenuItem();
	 //중략..
}

 

this.components = new System.ComponentModel.Container(); 

이게 보통 InitializeComponent() 안에 자동으로 정의가 되어 있어야 하는데
왜 인지 모르겠지만 코드가 지워져 있었습니다.
이 한줄 때문에 강력한 서명이니 뭐니 하면서 오류가 발생했었네요.

위 코드가 없을 경우 폼디자인도 정상적으로 표시되지 않고 오류가 발생합니다.
다소 황당한 경험이였지만, 혹시 저처럼 처음보는 오류 메세지가 발생하는 경우
이전 코드와 디자이너 소스에도 변경된 부분이 없는지 확인하는 과정이 필요할 것 같습니다.

댓글

💲 추천 글