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
PS C:\app> .\MyProject.Rest.exe
Unhandled Exception:
I have the following version of .Net Framework installed on the container
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:
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后,某些功能不支持一切正常。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.