为什么这个dotnettesting只在Docker容器中运行崩溃?
我有这个.NET Core 1.1解决scheme,包括一个ASP.NET Core项目和一个NUnittesting项目。 每个项目都有必要的属性(如果需要,我可以显示更多)。
<PropertyGroup> <TargetFramework>netcoreapp1.1</TargetFramework> <RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion> </PropertyGroup>
我可以在本地恢复,构build和运行testing套件(Windows 10),没有任何问题。
$ dotnet restore Restoring packages for... Restore completed in... Generating MSBuild file... $ dotnet build Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. Example -> ... Test -> ... Build succeeded. 0 Warning(s) 0 Error(s) Time Elapsed ... $ cd test/ $ dotnet test Build started, please wait... Build completed. Test run for ... Microsoft (R) Test Execution Command Line Tool Version 15.3.0-preview-20170628-02 Copyright (c) Microsoft Corporation. All rights reserved. Starting test execution, please wait... NUnit Adapter 3.8.0.0: Test execution started Running all tests in ... NUnit3TestExecutor converted 11 of 11 NUnit test cases Total tests: 11. Passed: 11. Failed: 0. Skipped: 0. Test Run Succeeded. Test execution time: ...
testing套件使用NUnit 3,我使用所有最新的稳定版本。 这里是有趣的包装参考。
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" /> <PackageReference Include="Microsoft.DotNet.InternalAbstractions" Version="1.0.0" /> <PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.3" /> <PackageReference Include="FluentAssertions" Version="4.19.3" /> <PackageReference Include="Microsoft.AspNetCore.TestHost" Version="1.1.3" /> <PackageReference Include="NUnit" Version="3.8.1" /> <PackageReference Include="NUnit3TestAdapter" Version="3.8.0" />
但是,当我从.NET Core SDK Docker映像/容器运行testing时,它们显着失败!
主动testing运行被中止。 原因:无法与testing主机进程通信。
这是简单的Dockerfile
FROM microsoft/dotnet:1.1-sdk WORKDIR /app COPY . .
恢复和build立工作find,但testing中止!
$ docker image build --tag example:latest . ... $ docker container run --rm -it example:latest root@abcdef12345:/app# dotnet restore ... root@abcdef12345:/app# dotnet build ... root@abcdef12345:/app# cd test/ root@abcdef12345:/app# dotnet test ... Microsoft (R) Test Execution Command Line Tool Version 15.0.0.0 Copyright (c) Microsoft Corporation. All rights reserved. Starting test execution, please wait... NUnit Adapter 3.8.0.0: Test execution started Running all tests in ... NUnit3TestExecutor converted 11 of 11 NUnit test cases The active test run was aborted. Reason: Unable to communicate with test host process.
search这个错误信息让我无处可去。 我不知道如何debugging一个testing运行中止。 较高级别的冗长性不会打印任何有用的内容。 让我知道我可以尝试获取更多信息,消除可能性,并提供更有用的信息!
- Dotnet Core从Mac发布到IIS
- 由于缺lessdll:s,因此使用.NET Core 2.0构buildDocker多阶段失败
- 在dotnet发布后,在docker映像中找不到Application Insights依赖关系
- dotnet核心应用程序不从docker容器写入WebDAV
- WebSocket客户端错误.net核心与Linux Docker图像与botframework直线
- 运行在Docker容器中并在Kubernetes上运行的dotnet核心Web API
- 在Windows的Windows子系统中运行Docker中的.Net Core
- Nginx – 反向代理
- Dotnet核心Docker应用挂在Synology版本上