Когда я пытаюсь запустить Live Unit Test кода из приложения-функции Azure, оно будет построено один раз, а затем не сможет быть построено в следующий раз, когда вносятся изменения, даже если он создается вручную и запускается тест из приложения. Test Explored работает отлично.
Я создал совершенно новое решение, совершенно новое приложение-функцию и новый проект MS Test и добавил этот класс в проект приложения-функции:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FunctionApp1
{
public class Poc
{
public bool IsTrue { get; } = true;
}
}
И этот тест
using FunctionApp1;
namespace FuncitonApp.Tests
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
var sut = new Poc();
Assert.IsTrue(sut.IsTrue);
}
}
}
Я могу без проблем создать решение вручную. Можно запустить тест MS в обычном обозревателе тестов, проблем нет, но когда я пытаюсь запустить тест как Live Unit Test, я получаю следующий результат Live Unit Test:
[3:33:09 PM Info] Live Unit Testing started.
[3:33:09 PM Info] Building solution.
[3:33:10 PM Info] Loading projects.
[3:33:12 PM Info] Triggering NuGet package restore.
[3:33:14 PM Info] Building project 'FunctionApp1'.
[3:33:28 PM Info] Build failed for project 'FunctionApp1'.
[3:33:28 PM Error] Build completed with failures. Errors were logged under file:///C:/Users/DarylLaBar/source/lut/FunctionApp1/v2/0/diag/build.minimal.log
[3:37:31 PM Info] Building 1 test projects.
[3:37:32 PM Info] Loading projects.
[3:37:32 PM Info] Building project 'FunctionApp1'.
[3:37:41 PM Info] Build failed for project 'FunctionApp1'.
[3:37:41 PM Error] Build completed with failures. Errors were logged under file:///C:/Users/DarylLaBar/source/lut/FunctionApp1/v2/0/diag/build.minimal.log
С помощью файла build.minimal.log:
C:\Users\DarylLaBar\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.0\build\Microsoft.Azure.Functions.Worker.Sdk.targets(110,5): warning : Could not write function metadata. Error: 'Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'. Beginning retry 1 of 10 in 1000ms.
C:\Users\DarylLaBar\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.0\build\Microsoft.Azure.Functions.Worker.Sdk.targets(110,5): warning : Could not write function metadata. Error: 'Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'. Beginning retry 2 of 10 in 1000ms.
C:\Users\DarylLaBar\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.0\build\Microsoft.Azure.Functions.Worker.Sdk.targets(110,5): warning : Could not write function metadata. Error: 'Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'. Beginning retry 3 of 10 in 1000ms.
C:\Users\DarylLaBar\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.0\build\Microsoft.Azure.Functions.Worker.Sdk.targets(110,5): warning : Could not write function metadata. Error: 'Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'. Beginning retry 4 of 10 in 1000ms.
C:\Users\DarylLaBar\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.0\build\Microsoft.Azure.Functions.Worker.Sdk.targets(110,5): warning : Could not write function metadata. Error: 'Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'. Beginning retry 5 of 10 in 1000ms.
C:\Users\DarylLaBar\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.0\build\Microsoft.Azure.Functions.Worker.Sdk.targets(110,5): warning : Could not write function metadata. Error: 'Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'. Beginning retry 6 of 10 in 1000ms.
C:\Users\DarylLaBar\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.0\build\Microsoft.Azure.Functions.Worker.Sdk.targets(110,5): warning : Could not write function metadata. Error: 'Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'. Beginning retry 7 of 10 in 1000ms.
C:\Users\DarylLaBar\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.0\build\Microsoft.Azure.Functions.Worker.Sdk.targets(110,5): warning : Could not write function metadata. Error: 'Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'. Beginning retry 8 of 10 in 1000ms.
C:\Users\DarylLaBar\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.0\build\Microsoft.Azure.Functions.Worker.Sdk.targets(110,5): warning : Could not write function metadata. Error: 'Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'. Beginning retry 9 of 10 in 1000ms.
C:\Users\DarylLaBar\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.0\build\Microsoft.Azure.Functions.Worker.Sdk.targets(110,5): error : Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
C:\Users\DarylLaBar\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.0\build\Microsoft.Azure.Functions.Worker.Sdk.targets(110,5): error : Unable to build Azure Functions metadata for obj\Debug\net8.0\FunctionApp1.dll
Build FAILED.
C:\Users\DarylLaBar\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.0\build\Microsoft.Azure.Functions.Worker.Sdk.targets(110,5): warning : Could not write function metadata. Error: 'Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'. Beginning retry 1 of 10 in 1000ms.
C:\Users\DarylLaBar\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.0\build\Microsoft.Azure.Functions.Worker.Sdk.targets(110,5): warning : Could not write function metadata. Error: 'Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'. Beginning retry 2 of 10 in 1000ms.
C:\Users\DarylLaBar\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.0\build\Microsoft.Azure.Functions.Worker.Sdk.targets(110,5): warning : Could not write function metadata. Error: 'Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'. Beginning retry 3 of 10 in 1000ms.
C:\Users\DarylLaBar\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.0\build\Microsoft.Azure.Functions.Worker.Sdk.targets(110,5): warning : Could not write function metadata. Error: 'Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'. Beginning retry 4 of 10 in 1000ms.
C:\Users\DarylLaBar\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.0\build\Microsoft.Azure.Functions.Worker.Sdk.targets(110,5): warning : Could not write function metadata. Error: 'Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'. Beginning retry 5 of 10 in 1000ms.
C:\Users\DarylLaBar\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.0\build\Microsoft.Azure.Functions.Worker.Sdk.targets(110,5): warning : Could not write function metadata. Error: 'Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'. Beginning retry 6 of 10 in 1000ms.
C:\Users\DarylLaBar\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.0\build\Microsoft.Azure.Functions.Worker.Sdk.targets(110,5): warning : Could not write function metadata. Error: 'Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'. Beginning retry 7 of 10 in 1000ms.
C:\Users\DarylLaBar\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.0\build\Microsoft.Azure.Functions.Worker.Sdk.targets(110,5): warning : Could not write function metadata. Error: 'Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'. Beginning retry 8 of 10 in 1000ms.
C:\Users\DarylLaBar\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.0\build\Microsoft.Azure.Functions.Worker.Sdk.targets(110,5): warning : Could not write function metadata. Error: 'Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'. Beginning retry 9 of 10 in 1000ms.
C:\Users\DarylLaBar\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.0\build\Microsoft.Azure.Functions.Worker.Sdk.targets(110,5): error : Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
C:\Users\DarylLaBar\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.0\build\Microsoft.Azure.Functions.Worker.Sdk.targets(110,5): error : Unable to build Azure Functions metadata for obj\Debug\net8.0\FunctionApp1.dll
9 Warning(s)
2 Error(s)
Time Elapsed 00:00:09.37
Подробнее здесь: https://stackoverflow.com/questions/785 ... on-project
Как запустить Live Unit Test для проекта функции Azure? ⇐ C#
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Visual Studio выдает ошибку: Node
::item использует неопределенный класс Unit
Anonymous » » в форуме C++ - 0 Ответы
- 72 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Xcode – Unit Test – компиляция для iOS 12, но модуль имеет минимальную цель развертывания 13
Anonymous » » в форуме IOS - 0 Ответы
- 22 Просмотры
-
Последнее сообщение Anonymous
-