我们有一个 Azure WebJob (3.x) 在 Azure 中的 API 应用程序下运行,全部为 Core 2.1。它可以正常发布并运行,但不显示任何函数或在仪表板上列出函数调用。这很奇怪,因为作业的控制台输出确实显示它检测到一个函数:
[10/17/2018 09:26:19 > fa7c81: SYS INFO] Run script 'run.cmd' with script host - 'WindowsScriptHost'
[10/17/2018 09:26:19 > fa7c81: SYS INFO] Status changed to Running
[10/17/2018 09:26:19 > fa7c81: INFO]
[10/17/2018 09:26:19 > fa7c81: INFO] D:\local\Temp\jobs\continuous\SubmissionJob\43ucb4rv.ipc>dotnet SubmissionJob.dll
[10/17/2018 09:26:21 > fa7c81: INFO] dbug: Microsoft.Extensions.Hosting.Internal.Host[1]
[10/17/2018 09:26:21 > fa7c81: INFO] Hosting starting
[10/17/2018 09:26:21 > fa7c81: INFO] info: Microsoft.Azure.WebJobs.Hosting.JobHostService[0]
[10/17/2018 09:26:21 > fa7c81: INFO] Starting JobHost
[10/17/2018 09:26:21 > fa7c81: INFO] …Run Code Online (Sandbox Code Playgroud) 我遇到了一段非常简单的 C# .NET 代码的问题,它应该(现在)只需检索运行 WinForms 应用程序的计算机上安装的 Office 版本号:
var oApp = new Outlook.ApplicationClass();
var outlookVersionString = oApp.Version;
Run Code Online (Sandbox Code Playgroud)
它正确实例化对象,但是当我尝试访问 Version 属性时,我得到以下信息:
{"Unable to cast COM object of type 'Microsoft.Office.Interop.Outlook.ApplicationClass' to interface type 'Microsoft.Office.Interop.Outlook._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00063001-0000-0000-C000-000000000046}' failed due to the following error: Interface not registered (Exception from HRESULT: 0x80040155)."}
我在网上做了很多搜索,所以我尝试过的东西:
[HKEY_CLASSES_ROOT\TypeLib\{00062FFF-0000-0000-C000-000000000046}]只有一个 Key 存在 ( 9.6)[HKEY_CLASSES_ROOT\Interface\{00063001-0000-0000-C000-000000000046}]C:\Windows\Microsoft.NET\Framework64\v4.0.30319\regtlibv12.exe "C:\Program Files …