找不到DLL C:\ Windows \ Microsoft.Net \ Framework64 \ v4.0.30319 \ WPF \ wpfgfx_v0400.dll

时间:2017-11-13 18:06:58

标签: c# wpf docker

我在Docker容器中托管一个WPF应用程序。我这样做是为了渲染图像服务器端并将它们传递回客户端。当我尝试使用应用程序时,它会告诉我

**[ModuleLoadException] The C++ module failed to load during appdomain initialization.**

   at <CrtImplementationDetails>.ThrowModuleLoadException(String errorMessage, Exception innerException)
   at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* )
   at .cctor()


**[DllNotFoundException] C:\Windows\Microsoft.NET\Framework64\v4.0.30319\WPF\wpfgfx_v0400.dll**

at MS.Internal.NativeWPFDLLLoader.LoadNativeWPFDLL(UInt16* relDllPath, UInt16* baseDllPath)
   at MS.Internal.NativeWPFDLLLoader.LoadCommonDLLsAndDwrite()
   at CModuleInitialize.{ctor}(CModuleInitialize* , IntPtr cleaningUpFunc)
   at ?A0x9df993ac.CreateCModuleInitialize()
   at ?A0x9df993ac.??__E?A0x9df993ac@cmiStartupRunner@@YMXXZ()
   at _initterm_m((fnptr)* pfbegin, (fnptr)* pfend)
   at <CrtImplementationDetails>.LanguageSupport.InitializePerAppDomain(LanguageSupport* )
   at <CrtImplementationDetails>.LanguageSupport._Initialize(LanguageSupport* )
   at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* )

**[Win32Exception] The specified module could not be found**

它寻找的模块位于容器内部 Here is the Dll in its expected folder

有没有人知道最新情况?

这是docker文件:

FROM microsoft/aspnet


RUN mkdir C:\WcfService

COPY . /app

RUN /vcredist_x86.exe /install /quiet /norestart /log 
%TEMP%\vcredist_2013_x86.log



RUN /vcredist_x64.exe /install /quiet /norestart /log 
%TEMP%\vcredist_2013_x64.log

RUN powershell.exe -executionpolicy bypass c:\app\SetupScript.ps1

EXPOSE 80

这是setup script.ps1

Import-Module "WebAdministration"
Add-WindowsFeature NET-WCF-TCP-Activation45
Add-WindowsFeature NET-WCF-HTTP-Activation45
Add-WindowsFeature Web-WebSockets
Add-WindowsFeature Web-Server
Add-WindowsFeature -Name NET-Framework-Core
$sharepath = "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files"
$Acl = Get-ACL $sharepath
$AccessRule= New-Object System.Security.AccessControl.FileSystemAccessRule("everyone","full","ContainerInherit,Objectinherit","none","Allow")
$Acl.AddAccessRule($AccessRule)
Add-LocalGroupMember -Group 'Administrators' -Member 'IIS AppPool\DefaultAppPool'; 
net localgroup administrators "IIS AppPool\DefaultAppPool" /add
Set-Acl $SharePath $Acl 
Remove-WebSite -Name 'Default Web Site'
New-Website -Name 'CentralServices' -Port 80 -PhysicalPath 'c:\app'
Start-WebSite -Name "CentralServices"

Docker版本17.09。

0 个答案:

没有答案