Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
部署到Azure网站时Microsoft.VisualStudio.QualityTools.UTFResources的FileNotFoundException_Azure_Azure Web App Service_Kudu - Fatal编程技术网

部署到Azure网站时Microsoft.VisualStudio.QualityTools.UTFResources的FileNotFoundException

部署到Azure网站时Microsoft.VisualStudio.QualityTools.UTFResources的FileNotFoundException,azure,azure-web-app-service,kudu,Azure,Azure Web App Service,Kudu,我正在使用Azure网站git deploy(通过Kudu),直到今天,一切都进展顺利。当我执行新的git推送时,它尝试部署,我在测试运行时收到以下错误消息: 错误:System.IO.FileNotFoundException:无法加载文件或程序集“Microsoft.VisualStudio.QualityTools.UTFResources,Version=10.1.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”或其依赖项之一。系统

我正在使用Azure网站git deploy(通过Kudu),直到今天,一切都进展顺利。当我执行新的git推送时,它尝试部署,我在测试运行时收到以下错误消息:

错误:System.IO.FileNotFoundException:无法加载文件或程序集“Microsoft.VisualStudio.QualityTools.UTFResources,Version=10.1.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”或其依赖项之一。系统找不到指定的文件

从上次成功推送到出现此错误之间,我没有从解决方案中添加或删除任何库或其他引用。谷歌搜索没有发现任何东西。该文件在我的本地GAC中,但我在解决方案中的任何地方都找不到直接引用的文件

重新部署我的解决方案的旧版本(在当天早些时候正确部署的版本)失败,并显示相同的错误消息

如果我不知道的话,我会认为MS在他们这方面改变了什么,打破了kudu

有没有想过解决这个问题,怕在Azure上开罚单

编辑-更多详细信息:

它在运行单元测试时失败。以下是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
在成功运行一系列单元测试之后,但在完成之前,它在第一次调用
vstest.console.exe时失败。下面是日志文件的一个示例:

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.

我应该注意,如果我注释掉对单元测试的调用,我可以让它部署。所以我想问题基本上是-我能做些什么让我的单元测试再次运行?Azure网站的最新更新(除其他外,支持TypeScript 1.1)是否可能从GAC中删除了Microsoft.VisualStudio.QualityTools.UTFResources.dll
?或者是类似的东西?

正如评论中所讨论的,这似乎是最近的倒退。我已经开始跟踪它,并进行了进一步讨论。

请看这里:

建议取消对Microsoft.VisualStudio.QualityTools.UnitTestFramework的引用,并添加NuGet软件包MSTest.TestFrameworkMSTest.TestAdapter

在我的VSTS构建定义中,我还必须更改签出过程以清理所有构建目录


这解决了同一DLL的FileNotFound异常。

我只是将版本从10.1.0.0降低到10.0.0.0。成功了

要进行故障排除,部署到新站点时是否也会发生这种情况?此外,Kudu默认情况下不运行测试。您是否有自定义部署脚本来执行此操作?您能否从部署中提供更多的输出,以显示这是在哪一步进行的?@davidebo-感谢您的响应。我添加了更多细节。谢谢你提供的额外信息。您是否能够尝试一个干净的站点,以确保它不是由于某个站点中的某些内容处于不好的状态?理想情况下,如果你能够分享证明失败的公开回购协议,这将有助于调查。我们使用的用于进行单元测试的repo仍在使用最新版本,因此肯定存在一些差异。另外,还有一件事:该程序集甚至在之前都不在GAC中。所以问题似乎是,现在有东西试图加载它,而以前没有。@davidebo-我部署到一个新网站,遇到了同样的问题。鉴于之前使用相同的deploy.cmd和相同的.sln文件工作,我不得不想象服务器端发生了一些变化。至少,数据似乎表明解决方案本身没有任何变化。谢谢!我尝试了GitHub问题中提到的解决方法,但是当我将程序集从10.1.0.0更改为10.0.0.0时,测试资源管理器找不到单元测试。