简体   繁体   English

使用 Docker windowsservercore 的 C# 未处理异常(没有消息)

[英]C# Unhandled Exception (with no message) using Docker windowsservercore

microsoft.com/dotnet/framework/runtime:4.6.2-windowsservercore-ltsc2016 image to run a .Net Framework 4.6.1 project that was built with MSbuild`, it runs fine running it stand alone in a windows machine but when it comes to docker it doesn't work and the only exception I got is an empty message microsoft.com/dotnet/framework/runtime:4.6.2-windowsservercore-ltsc2016 image to run a project that was built with ,它可以在 Windows 机器中独立运行但运行良好到 docker 它不起作用,我得到的唯一例外是一条空消息

PS C:\app> .\MyProject.Rest.exe

Unhandled Exception:

I have the following version of .Net Framework installed on the container我在容器上安装了以下版本的 .Net Framework

PS C:\app> (Get-ItemProperty "HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full").Version
4.8.03761
PS C:\app> Get-ComputerInfo | select WindowsProductName, WindowsVersion, OsHardwareAbstractionLayer

WindowsProductName             WindowsVersion OsHardwareAbstractionLayer
------------------             -------------- --------------------------
Windows Server 2016 Datacenter                10.0.14393.3297


PS C:\app>

The Dockerfile contains the following: Dockerfile 包含以下内容:

FROM mcr.microsoft.com/dotnet/framework/runtime:4.6.2-windowsservercore-ltsc2016
SHELL ["powershell"]

COPY . 'C:\\app\\'
EXPOSE 10003
WORKDIR 'C:\\app\\'

CMD MyProject.Rest.exe

And the project was build with the following command:该项目是使用以下命令构建的:

MSBuild.exe '.\Project\Project.sln' /t:Build /p:Configuration=Release /p:Platform="Any CPU" /p:RunOctoPack=true /p:OctoPackPackageVersion=$env:appveyor_build_version

Any help will be appreciated.任何帮助将不胜感激。

问题是运行环境,我们使用的是Windows Server 2012 ,并且在更新到Windows Server 2016后,某些功能不支持一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM