У меня есть UnitTests.dll
, на который ссылается Common.dll
(оба построены с VS2015).Ошибка сборки сборки vstset.console.exe
Я следующая структура каталогов:
C:\Test\
- UnitTests.dll
- UnitTests.runsettings
C:\Bin\
- Common.dll
UnitTests.runsettings
содержания следующим образом:
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<RunConfiguration>
<TargetPlatform>x64</TargetPlatform>
</RunConfiguration>
<MSTest>
<MapInconclusiveToFailed>True</MapInconclusiveToFailed>
<CaptureTraceOutput>False</CaptureTraceOutput>
<DeleteDeploymentDirectoryAfterTestRunIsComplete>False</DeleteDeploymentDirectoryAfterTestRunIsComplete>
<DeploymentEnabled>False</DeploymentEnabled>
<AssemblyResolution>
<Directory Path="C:\Bin\" includeSubDirectories="true" />
</AssemblyResolution>
</MSTest>
</RunSettings>
Я призываю испытание:
C:\Test> vstest.console.exe UnitTests.dll /settings:UnitTests.runsettings /inIsolation
vstest.console.exe
ссылается C: \ Program Files (x86) \ Microsoft Visual Studio 14.0 \ Common7 \ IDE \ CommonExtensions \ Microsoft \ TestWindow \ vstest.console.exe.
я получать следующее сообщение об ошибке:
Starting test execution, please wait...
Failed TestMethod1
Error Message:
Test method UnitTests.UnitTest1.TestMethod1 threw exception: System.IO.FileNotFoundException: Could not load file or assembly 'Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Stack Trace:
at UnitTests.UnitTest1.TestMethod1()
Больше с Fusion Вход включен:
Starting test execution, please wait...
Failed TestMethod1
Error Message:
Test method UnitTests.UnitTest1.TestMethod1 threw exception: System.IO.FileNotFoundException: Could not load file or assembly 'Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
=== Pre-bind state information ===
LOG: DisplayName = Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///C:/Test
LOG: Initial PrivatePath = NULL
Calling assembly : UnitTests, 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)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.executionengine.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Test/Common.DLL.
LOG: Attempting download of new URL file:///C:/Test/Common/Common.DLL.
LOG: Attempting download of new URL file:///C:/Test/Common.EXE.
LOG: Attempting download of new URL file:///C:/Test/Common/Common.EXE.
Stack Trace:
at UnitTests.UnitTest1.TestMethod1()
ли лицо, я какой-то вопрос кэширования? Как убедить vstest.console.exe
искать зависимости внутри C:\Bin\
(как теоретически указано AssemblyResolution
)?
ОБНОВЛЕНИЕ:
Submitted as a bug to MSFT on connect (с репро шагов - на вкладке Информация в нижней части).
Существующие ограничения разрешения сборки и принудительное использование атрибута DeploymentItem
, не масштабируются вообще. Избыточные затраты на техническое обслуживание (когда разработчики вынуждены вручную отслеживать, какие зависимости требуются для выполнения единичных тестов) вводит трение к тестам. Любые проблемы, возникающие в результате этого трения, очень трудно устранить.
'DeploymentItem' атрибут работает, когда вы предоставляете полный путь и установить' DeploymentEnabled' элемент 'true' в' .runsettings' файле. Атрибут 'DeploymentItem' не распознает переменные среды, несмотря на то, что это показано в примерах в MSDN. Разочарование также является тем фактом, что элемент 'AssemblyResolution' больше не работает (например, ранее в файле' .estestsettings'), но он все еще существует. – jwaliszko
сообщите об этом как об ошибке для MS: connect.microsoft.com/VisualStudio/Feedback/ – magicandre1981
Я действительно собирался это сделать. – jwaliszko