2017-04-26 9 views
0

안녕하세요, 저는 최근에 vitruvius를 건너 왔고 kinect 제스처와 함께 작동하는 wpf 프로젝트에서 플러그인을 구현하려고했지만 아래에 표시된 것처럼 자습서를 사용할 수 없었습니다. Vitruvius 제스처가 작동하지 않습니다, System.Windows.Markup.XamlParseException

https://vitruviuskinect.com/blog/

각 단계를 다음과 샘플 작업 코드를 다운로드하지만 자신이 오류 메시지는 다음과 같습니다 것이라고했다.

Click here to see the error message Image on Visual Studio

전체

오류 메시지는 다음과 같다. 이 프로젝트는 "MSIL"건설되고 의 프로세서 아키텍처 간의 불일치와 참조 "LightBuzz.Vitruvius의 프로세서 아키텍처가 발생했습니다 경고

심각도 코드 설명 프로젝트 파일 라인 억제 상태 = 1.0 버전. 0.0, 문화 = 중립, processorArchitecture = AMD64 ","AMD64 ". 이 불일치로 인해 런타임에 오류가 발생할 수 있습니다. 구성 관리자를 통해 프로젝트의 대상 프로세서 아키텍처 을 변경하여 프로세서 아키텍처를 프로젝트와 참조간에 정렬하거나 프로젝트의 대상 프로세서 아키텍처와 일치하는 프로세서 아키텍처를 사용하는 참조에 종속성을 적용하십시오. . TEST2

MainWindow.xaml.cs를 작성 코드는

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using System.Threading.Tasks; 
using System.Windows; 
using System.Windows.Controls; 
using System.Windows.Data; 
using System.Windows.Documents; 
using System.Windows.Input; 
using System.Windows.Media; 
using System.Windows.Media.Imaging; 
using System.Windows.Navigation; 
using System.Windows.Shapes; 
using Microsoft.Kinect; 
using LightBuzz.Vitruvius; 


namespace test2 
{ 
    /// <summary> 
    /// Interaction logic for MainWindow.xaml 
    /// </summary> 
    public partial class MainWindow : Window 
    { 
     KinectSensor _sensor; 
     MultiSourceFrameReader _reader; 
     GestureController _gestureController; 


     public MainWindow() 
     { 
      InitializeComponent(); 

      _sensor = KinectSensor.GetDefault(); 

      if (_sensor != null) 
      { 
       _sensor.Open(); 

       _reader = _sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Body); 
       _reader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived; 

       _gestureController = new GestureController(); 
       _gestureController.GestureRecognized += GestureController_GestureRecognized; 
      } 


     } 



     void Reader_MultiSourceFrameArrived(object sender, MultiSourceFrameArrivedEventArgs e) 
     { 
      var reference = e.FrameReference.AcquireFrame(); 



      // Body 
      using (var frame = reference.BodyFrameReference.AcquireFrame()) 
      { 
       if (frame != null) 
       { 
        Body body = frame.Bodies().Closest(); 

        if (body != null) 
        { 
         _gestureController.Update(body); 
        } 
       } 
      } 
     } 

     void GestureController_GestureRecognized(object sender, GestureEventArgs e) 
     { 
      lbGesture.Content = e.GestureType.ToString(); 
     } 

    } 
} 

정말 누군가가이 문제를 해결하는 데 도움 수 있기를 바랍니다 파일! 미리 감사드립니다.

답변

1

x64 용으로 컴파일 된 (또는 MSIL에서 64 비트 코드를 생성하도록 지시 한) 어셈블리를 사용하려고합니다 .... 그러나 응용 프로그램은 아마도 x86을 대상으로합니다 (또는 AnyCPU을 사용하고 있습니다. Windows의 32 비트 버전에서 실행).

프로젝트와 참조하는 어셈블리가 동일한 "아키텍처"로 확인되어야합니다.

github에서 프로젝트 코드를 보면 프로젝트 파일이 64 비트 참조를 명시 적으로 설정하도록 편집 된 것 같습니다. 즉, 64 비트 시스템에 있고 프로젝트에서 AnyCPU를 사용하거나 플랫폼 유형으로 x64를 사용하는 경우에만 작동합니다.

x64를 사용하기 위해 누군가가이 x86 구성을 어떻게 변경했는지보십시오.

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> 
    <PlatformTarget>x64</PlatformTarget> 
    <OutputPath>bin\x86\Release\</OutputPath> 
    </PropertyGroup> 

그리고 오직 kinect 라이브러리의 64 비트 풍미에 대한 참조 만 사용합니다. 당신이 32 비트 응용 프로그램을 갖고 싶어

<Reference Include="Microsoft.Kinect, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=AMD64"> 

는, 당신은 플랫폼 유형으로 86을 사용할 필요가 있고, 당신은 32 비트가 그래서 그 참조를 변경해야합니다.

은 다음을 참조하십시오 How do I fix the Visual Studio compile error, "mismatch between processor architecture"?

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> 
    <DebugType>pdbonly</DebugType> 
    <Optimize>true</Optimize> 
    <OutputPath>bin\Release\</OutputPath> 
    <DefineConstants>TRACE</DefineConstants> 
    <ErrorReport>prompt</ErrorReport> 
    <WarningLevel>4</WarningLevel> 
    <Prefer32Bit>false</Prefer32Bit> 
    <PlatformTarget>x64</PlatformTarget> 
    <DocumentationFile>bin\Release\LightBuzz.Vitruvius.XML</DocumentationFile> 
    </PropertyGroup> 
    <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> 
    <PlatformTarget>AnyCPU</PlatformTarget> 
    <OutputPath>bin\x86\Debug\</OutputPath> 
    </PropertyGroup> 
    <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> 
    <PlatformTarget>x64</PlatformTarget> 
    <OutputPath>bin\x86\Release\</OutputPath> 
    </PropertyGroup> 
    <ItemGroup> 
    <Reference Include="Microsoft.Kinect, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=AMD64"> 
     <SpecificVersion>False</SpecificVersion> 
     <HintPath>..\..\..\..\..\..\Program Files\Microsoft SDKs\Kinect\v2.0-DevPreview1404\Assemblies\Microsoft.Kinect.dll</HintPath> 
    </Reference> 
+1

오 감사합니다!x64로 바꾼 후에는 이제 괜찮 았어. – bingcheng45