4

I'm using Azure Websites git deploy (via Kudu), and everything has been going great, until today. When I do a new git push, and it tries to deploy, I get this error message while my tests are running:

Error: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.UTFResources, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

I haven't added or removed any libraries or other references from my solution between the last successful push and when I started getting this errors. Googling doesn't turn up anything. That file is in my local GAC, but I can't find it referenced directly anywhere in my solution.

Redeploying an old version of my solution - a version that deployed correctly earlier in the day - fails with the same error message.

If I didn't know better, I'd think that MS changed something on their end and broke kudu.

Any thoughts about troubleshooting this, shy of opening a ticket with Azure?

EDIT - More Details:

It's failing while running the unit tests. Here's the relevant portion of my deploy.cmd:

:: 1. Build to the temporary path
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  %MSBUILD_PATH% "%DEPLOYMENT_SOURCE%\Payboard.Web\Payboard.Web.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="%DEPLOYMENT_TEMP%";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS%
) ELSE (
  %MSBUILD_PATH% "%DEPLOYMENT_SOURCE%\Payboard.Web\Payboard.Web.csproj" /nologo /verbosity:m /t:Build /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS%
)

IF !ERRORLEVEL! NEQ 0 (
    echo Build failed with ErrorLevel !0!
    goto error
)

:: 2. Building test projects
rem echo Building test projects
"%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\PayboardWeb.sln" /p:Configuration=NoDatabase;VisualStudioVersion=12.0 /verbosity:m /p:Platform="Any CPU"


IF !ERRORLEVEL! NEQ 0 (
    echo Build failed with ErrorLevel !0!
    goto error
)

:: 3. Running tests
echo Running tests
vstest.console.exe "%DEPLOYMENT_SOURCE%\Payboard.Common.Tests\bin\NoDatabase\Payboard.Common.Tests.dll"
IF !ERRORLEVEL! NEQ 0 goto error
vstest.console.exe "%DEPLOYMENT_SOURCE%\Payboard.Model.Tests\bin\NoDatabase\Payboard.Model.Tests.dll"
IF !ERRORLEVEL! NEQ 0 goto error
vstest.console.exe "%DEPLOYMENT_SOURCE%\Payboard.Services.Tests\bin\NoDatabase\Payboard.Services.Tests.dll"
IF !ERRORLEVEL! NEQ 0 goto error
vstest.console.exe "%DEPLOYMENT_SOURCE%\Payboard.Integrations.Tests\bin\NoDatabase\Payboard.Integrations.Tests.dll"
IF !ERRORLEVEL! NEQ 0 goto error
vstest.console.exe "%DEPLOYMENT_SOURCE%\Payboard.Web.Tests\bin\NoDatabase\Payboard.Web.Tests.dll"
IF !ERRORLEVEL! NEQ 0 goto error

It's failing during the first call to vstest.console.exe, after successfully running a whole bunch of the unit tests, but before finishing. Here's an example of the log file:

Passed   ConditionalFormatting_ShouldHandleSimpleConditions
Passed   ConditionalFormatting_ShouldHandleComplexNumericConditions
Passed   ConditionalFormatting_ShouldHandleNullStrings
Passed   ConditionalFormatting_ShouldHandleNullObjects
Error: Exception thrown executing tests in D:\home\site\repository\Payboard.Common.Tests\bin\NoDatabase\Payboard.Common.Tests.dll
Passed   ShallowClone_ShouldCopyIntegers
Passed   ShallowClone_ShouldCopyNullableIntegers
Error: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.UTFResources, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Passed   ShallowClone_ShouldCopyStrings
File name: 'Microsoft.VisualStudio.QualityTools.UTFResources, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Passed   ShallowClone_ShouldNotCopyReferences
Passed   ShallowClone_ShouldReturnNullIfSourceIsNull
Server stack trace: 
Passed   ShallowCopyTo_ShouldCopyIntegers
   at Microsoft.VisualStudio.TestTools.UnitTesting.ExpectedExceptionAttribute..ctor(Type exceptionType, String noExceptionMessage)
Passed   ShallowCopyTo_ShouldCopyNullableIntegers
   at Microsoft.VisualStudio.TestTools.UnitTesting.ExpectedExceptionAttribute..ctor(Type exceptionType)
Passed   ShallowCopyTo_ShouldCopyStrings
   at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
Passed   ShallowCopyTo_ShouldNotCopyReferences
   at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
Passed   ShallowCopyTo_ShouldNotCopyExceptions
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
Passed   ShallowCopyTo_ShouldNotCopyExceptionExpressions
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeMethodInfo method, RuntimeType caType, Boolean inherit)
Passed   GetFriendlyTypeName_ShouldHandleSimpleTypes
   at System.Reflection.RuntimeMethodInfo.GetCustomAttributes(Boolean inherit)
Passed   GetFriendlyTypeName_ShouldHandleComplexTypes
   at NUnit.Core.Reflect.GetAttributes(ICustomAttributeProvider member, Boolean inherit)
Passed   GetFriendlyTypeName_ShouldHandleReallyComplexTypes
   at NUnit.Core.Reflect.HasAttribute(ICustomAttributeProvider member, String attrName, Boolean inherit)
Passed   MultiDateTimeConverter_ShouldSupportMultipleFormats
   at NUnit.Core.Reflect.HasMethodWithAttribute(Type fixtureType, String attributeName, Boolean inherit)
Passed   OrIfGreater_ShouldSelectGreaterValue
   at NUnit.Core.Builders.NUnitTestFixtureBuilder.CanBuildFrom(Type type)
Passed   OrIfGreater_ShouldSelectRealValue
   at NUnit.Core.Extensibility.SuiteBuilderCollection.CanBuildFrom(Type type)
Passed   OrIfLesser_ShouldSelectGreaterValue
   at NUnit.Core.TestFixtureBuilder.CanBuildFrom(Type type)
Passed   OrIfLesser_ShouldSelectRealValue
   at NUnit.Core.Builders.TestAssemblyBuilder.GetFixtures(Assembly assembly, String ns)
Passed   GetKey_ShouldSupportStrings
   at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, Boolean autoSuites)
Passed   GetKey_ShouldSupportInts
   at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, String testName, Boolean autoSuites)
Passed   GetKey_ShouldSupportDates
   at NUnit.Core.TestSuiteBuilder.BuildSingleAssembly(TestPackage package)
Passed   ForEachParallel_ShouldExecuteAllActions
   at NUnit.Core.TestSuiteBuilder.Build(TestPackage package)
Passed   ForEachParallel_ShouldExecuteWithMaxParallelization
   at NUnit.Core.SimpleTestRunner.Load(TestPackage package)
Passed   SelectParallel_ShouldSelectAllData
   at NUnit.Core.ProxyTestRunner.Load(TestPackage package)
Passed   SelectParallel_ShouldSelectWithMaxParallelization
   at NUnit.Core.ProxyTestRunner.Load(TestPackage package)
Passed   SortOfMatches_ShouldMatchSameUrls
   at NUnit.Core.RemoteTestRunner.Load(TestPackage package)
Passed   SortOfMatches_ShouldIgnoreQueryStrings
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
Passed   SortOfMatches_ShouldIgnoreShortPrefixes
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
Passed   SortOfMatches_ShouldNotMatchOnPathMismatch
Passed   SortOfMatches_ShouldNotMatchOnHostMismatch
Exception rethrown at [0]: 
Passed   MainDomain_ShouldRemoveWww
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
Passed   MainDomain_ShouldRemoveApp
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
Passed   MainDomain_ShouldNotRemoveExample
   at NUnit.Core.TestRunner.Load(TestPackage package)
Passed   MainDomain_ShouldNotRemoveMainDomain
   at NUnit.Util.TestDomain.Load(TestPackage package)
Passed   MainDomain_ShouldHandleCountryDomains
   at NUnit.VisualStudio.TestAdapter.NUnitTestExecutor.RunAssembly(String assemblyName, ITestExecutionRecorder testLog, TestFilter filter, IRunContext runContext)
Total tests: 117. Passed: 116. Failed: 0. Skipped: 1.
Test execution time: 7.5134 Seconds
An error has occurred during web site deployment.
Test Run Failed.

I should note that if I comment out the calls to the unit tests, I can get it to deploy. So I suppose the question is basically - what can I do to get my unit tests running again? Is it possible that the recent update to the Azure websites - the one that supported, among other things, TypeScript 1.1 - could have possibly removed Microsoft.VisualStudio.QualityTools.UTFResources.dll from the GAC? Or something along those lines?

4

3 回答 3

11

看看这里:

https://developercommunity.visualstudio.com/content/problem/35104/systemiofilenotfoundexception-utfresourcesdll.html

建议是取消引用Microsoft.VisualStudio.QualityTools.UnitTestFramework并添加 NuGet 包MSTest.TestFrameworkMSTest.TestAdapter

在我的 VSTS 构建定义中,我还必须更改结帐流程以清理所有构建目录

这解决了我为同一个 DLL 获得的 FileNotFound 异常。

于 2017-06-15T13:46:15.300 回答
1

正如评论中所讨论的,这似乎是最近的回归。我已经打开https://github.com/projectkudu/kudu/issues/1370来跟踪它并进一步讨论。

于 2014-10-27T18:52:02.407 回答
0

我只是将版本从 10.1.0.0 降低到 10.0.0.0。它奏效了!!!

于 2021-01-25T12:41:34.243 回答