2012-02-27 3 views
0

나는 포럼을 검색했지만, 나는 그다지 나를 만족시키지 못했습니다. 나는이 오류를 얻을 WPF 사용자 정의 컨트롤 추가하려고하면WPF 사용자 컨트롤 오류

마이크로 소프트 비주얼 스튜디오 2010

:

"An error occured trying to add references for type 'PolyPuttZe.GameCanvas', or finding the type. Make sure the project references are correct." 
: 다음

"Value cannot be null. Parameter name: objectType" 

내가 호스팅 된 내용을 선택합니다, 나는이 오류

이 자습서를 따라했습니다. http://www.switchonthecode.com/tutorials/wpf-tutorial-using-wpf-in-winforms

고마워요!

편집 :

이 내가 쓴 코드는 다음과 같습니다

using System; 
using System.Collections.Generic; 
using System.ComponentModel; 
using System.Data; 
using System.Drawing; 
using System.Linq; 
using System.Text; 
using System.Windows.Forms; 
using System.Windows.Forms.Integration; 

namespace PolyPuttZe 
{ 
    public partial class Game : Form 
    { 
     public Game() 
     { 
      InitializeComponent(); 
     } 
    } 
} 
+0

몇 가지 세부 정보를 표시하십시오. 이것이 ElementHost 안에 있습니까? objectType 매개 변수로 메소드 또는 ctor를 작성 했습니까? –

+0

나는 단계를 따라 winforms에서 드롭 다운을 볼 수있었습니다. 자습서를 작성한 후에 코드를 수정 했습니까? 코드를 보여주십시오. –

+0

Visual Studio에서 자동 생성 한 코드 만 작성했습니다. 비주얼 스튜디오는 ToolBox에서 WPF User Control을 알고 있지만 내 디자이너에 넣으려고 할 때 실수를합니다. – LolCat

답변

0

내가 그것을 작동있어! 내가 한 모든 일은 처음부터 끝내야했다. 이 프로젝트를 삭제하고 다른 컴퓨터에서 새 프로젝트를 만들었습니다. 그런 다음 오류가 사라지고 작동했습니다. 나를 도와 주신 모든 분들께 감사드립니다 !!