Visual studio 2012 Visual Studio 2012单元测试尝试加载较旧版本的程序集

Visual studio 2012 Visual Studio 2012单元测试尝试加载较旧版本的程序集,visual-studio-2012,mstest,windows-phone-8,Visual Studio 2012,Mstest,Windows Phone 8,我似乎无法运行任何单元测试。所有错误如下所示: 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, PublicKeyTok

我似乎无法运行任何单元测试。所有错误如下所示:

    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()
测试方法TvQueue.UnitTesting.TheTvDb.TheTvDbServiceTest.GetShowbasicTest引发异常:
System.IO.FileNotFoundException:无法加载文件或程序集“System.Windows,版本=2.0.6.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e”或其依赖项之一。系统找不到指定的文件。==预绑定状态信息===
日志:User=JKRTABLET\Jan
日志:DisplayName=System.Windows,版本=2.0.6.0,区域性=neutral,PublicKeyToken=7cec85d7bea7798e
(详细说明)
日志:Appbase=file:///C:/Users/Jan/Documents/Visual Studio 2012/Projects/TvQueue/TvQueue.UnitTesting/bin/Debug
日志:初始PrivatePath=NULL
调用程序集:TvQueue.Data,版本=1.0.0.0,区域性=neutral,PublicKeyToken=null。
===
日志:此绑定在默认加载上下文中启动。
日志:使用应用程序配置文件:C:\Program Files(x86)\JetBrains\ReSharper\v7.0\Bin\JetBrains.ReSharper.TaskRunner.CLR4.exe.Config
日志:使用主机配置文件:
日志:使用C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config中的计算机配置文件。
日志:发布策略参考:System.Windows,版本=2.0.6.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e
日志:正在尝试下载新URLfile:///C:/Users/Jan/Documents/Visual Studio 2012/Projects/TvQueue/TvQueue.UnitTesting/bin/Debug/System.Windows.DLL。
日志:正在尝试下载新URLfile:///C:/Users/Jan/Documents/Visual Studio 2012/Projects/TvQueue/TvQueue.UnitTesting/bin/Debug/System.Windows/System.Windows.DLL。
日志:正在尝试下载新URLfile:///C:/Users/Jan/Documents/Visual Studio 2012/Projects/TvQueue/TvQueue.UnitTesting/bin/Debug/System.Windows.EXE。
日志:正在尝试下载新URLfile:///C:/Users/Jan/Documents/Visual Studio 2012/Projects/TvQueue/TvQueue.UnitTesting/bin/Debug/System.Windows/System.Windows.EXE。
在TvQueue.Data.TheTvDb.TheTvDbService.d_u8.MoveNext()中
在System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start(参考TStateMachine stateMachine)
在System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start(参考TStateMachine stateMachine)
在TvQueue.Data.TheTvDb.TheTvDbService.GetShow(Int64 theTvDbId)
在TVbQueue.UnitTesting.TheTvDb.TheTvDbServiceTest.d_u0.MoveNext()中,在TvDBServiceTest.cs中:第19行
---来自引发异常的上一个位置的堆栈结束跟踪---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)
在System.Runtime.CompilerServices.TaskWaiter.HandleNonSuccessAndDebuggerNotification(任务任务)中
在System.Runtime.CompilerServices.TaskAwaiter.GetResult()中
我在开发WindowsPhone8代码时遇到了这个问题。出于某种原因,MSTest希望加载较旧版本的程序集(项目中实际引用的程序集为4.x或更高版本,MSTest希望加载2.x版本)

我怀疑这是一个配置问题,但我不知道如何解决它

谢谢你的帮助。

请看我的答案

项目中实际引用的程序集为4.x或更高版本

System.Windows,Version=2.0.6.0
不是旧版本,而是正确的新版本。你实际上看不到单个程序集的版本号,因为没有单独的程序集

请记住,主要的变化是Windows Phone 8与Windows RT一样,不再使用直接程序集,而是使用将多个程序集编译成单个API的WinMD文件