2012-11-02 10 views
1

단위 테스트를 실행할 수없는 것 같습니다. 모든 오류는 다음 줄에 있습니다.Visual Studio 2012 단위 테스트에서 이전 버전의 어셈블리를로드하려고 시도합니다.

Test method TvQueue.UnitTesting.TheTvDb.TheTvDbServiceTest.GetShowbasicTest threw exception: 
System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows, Version=2.0.6.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.=== Pre-bind state information === 
LOG: User = JKRTABLET\Jan 
LOG: DisplayName = System.Windows, Version=2.0.6.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e 
(Fully-specified) 
LOG: Appbase = file:///C:/Users/Jan/Documents/Visual Studio 2012/Projects/TvQueue/TvQueue.UnitTesting/bin/Debug 
LOG: Initial PrivatePath = NULL 
Calling assembly : TvQueue.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. 
=== 
LOG: This bind starts in default load context. 
LOG: Using application configuration file: C:\Program Files (x86)\JetBrains\ReSharper\v7.0\Bin\JetBrains.ReSharper.TaskRunner.CLR4.exe.Config 
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. 
LOG: Post-policy reference: System.Windows, Version=2.0.6.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e 
LOG: Attempting download of new URL file:///C:/Users/Jan/Documents/Visual Studio 2012/Projects/TvQueue/TvQueue.UnitTesting/bin/Debug/System.Windows.DLL. 
LOG: Attempting download of new URL file:///C:/Users/Jan/Documents/Visual Studio 2012/Projects/TvQueue/TvQueue.UnitTesting/bin/Debug/System.Windows/System.Windows.DLL. 
LOG: Attempting download of new URL file:///C:/Users/Jan/Documents/Visual Studio 2012/Projects/TvQueue/TvQueue.UnitTesting/bin/Debug/System.Windows.EXE. 
LOG: Attempting download of new URL file:///C:/Users/Jan/Documents/Visual Studio 2012/Projects/TvQueue/TvQueue.UnitTesting/bin/Debug/System.Windows/System.Windows.EXE. 

    at TvQueue.Data.TheTvDb.TheTvDbService.<GetShow>d__8.MoveNext() 
    at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start(ref TStateMachine stateMachine) 
    at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start(ref TStateMachine stateMachine) 
    at TvQueue.Data.TheTvDb.TheTvDbService.GetShow(Int64 theTvDbId) 
    at TvQueue.UnitTesting.TheTvDb.TheTvDbServiceTest.<GetShowbasicTest>d__0.MoveNext() in TheTvDbServiceTest.cs: line 19 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.GetResult() 

Windows Phone 8 코드를 개발할 때이 문제가 발생합니다. 어떤 이유로 MSTest는 이전 버전의 어셈블리를로드하려고합니다. 실제로 프로젝트에서 참조되는 어셈블리는 4.x 이상이고 MSTest는 2.x 버전을로드하려고합니다.

이것이 구성 문제라고 생각되지만 해결 방법을 모릅니다.

도와 주셔서 감사합니다.

답변

2

실제로 프로젝트에서 참조하는 How to use MSTest in VS2010 for Windows Phone 8 applications

어셈블리에 내 대답을 참조하십시오 4.x 또는

System.Windows, Version=2.0.6.0이 오래된 버전이 아닌 이상, 올바른 새 버전의입니다. 개별 어셈블리의 버전 번호를 실제로 볼 수 없으며 개별 어셈블리와 같은 것이 없습니다.

주요 변경 사항은 Windows RT와 같은 Windows Phone 8에서는 더 이상 직접 어셈블리를 사용하지 않지만 여러 어셈블리를 단일 API로 컴파일하는 WinMD 파일이라는 점을 기억하십시오.