2013-05-22 125 views
0

下面是制作过程中,我遇到了一些警告,此插件:Excel加载警告

Warning 1 
    Processing COM reference "" from path "C:\Windows\system32\stdole32.tlb". The type library importer could not convert the signature for the member 'DISPPARAMS.rgvarg'. 

    Warning 2 
    Processing COM reference "" from path "C:\Windows\system32\stdole32.tlb". The type library importer could not convert the signature for the member 'DISPPARAMS.rgdispidNamedArgs'. 

    Warning 3 
    Processing COM reference "VBA" from path "C:\Windows\system32\VEN2232.OLB". Type library importer has encountered an interface not derived from IUnknown: '_HiddenInterface'. 

这个插件的工作,因为它应该,但我想知道这些警告意思。当我看着他们时,我所看到的只是processing COM referencesconverting某些文件从system32文件夹中存在一些问题。我不知道更多关于它所以...

有人可以看看他们,给我一个更具体的解释,也许他们的一些解决方案。我会很感激每一个信息。

回答

2

这些错误没有什么大不了的。这仅表示COM类型库中的某些类型不能自动导入。从Visual Studio构建过程(或MSBuild任务,用于后端),我认为您不能删除这些错误。它们由.NET内部类型库导入程序生成,没有可以传递的标志。

您可以做的是在您的其他构建操作之前使用Tlbimp.exe (Type Library Importer)工具创建所需的互操作程序集,然后引用它们而不是让IDE完成这项工作。该工具的最新版本了解silence开关。

没有开关:

C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\x64]tlbimp C:\Windows\system32\stdole32.tlb 
Microsoft (R) .NET Framework Type Library to Assembly Converter 4.0.30319.17929 
Copyright (C) Microsoft Corporation. All rights reserved. 

TlbImp : warning TI3001 : Primary interop assembly 'stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is already registered for type library 'C:\Windows\system32\stdole32.tlb'. 
TlbImp : warning TI3002 : Importing a type library into a platform agnostic assembly. This can cause errors if the type library is not truly platform agnostic. 
TlbImp : warning TI3016 : The type library importer could not convert the signature for the member 'stdole.DISPPARAMS.rgvarg'. 
TlbImp : warning TI3016 : The type library importer could not convert the signature for the member 'stdole.DISPPARAMS.rgdispidNamedArgs'. 
TlbImp : warning TI3015 : At least one of the arguments for 'stdole.IDispatch.GetIDsOfNames' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code 
to manipulate. 
TlbImp : Type library imported to stdole.dll 

随着静音开关(多次出现):

C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\x64]tlbimp C:\Windows\system32\stdole32.tlb /silence:3016 /silence:3015 /silence:3001 /silence:3002 
Microsoft (R) .NET Framework Type Library to Assembly Converter 4.0.30319.17929 
Copyright (C) Microsoft Corporation. All rights reserved. 

TlbImp : Type library imported to stdole.dll 
+0

谢谢你这一点。 – Sylca

+0

这与[此处]相同的问题(https://social.msdn.microsoft.com/Forums/vstudio/en-US/137dc006-90cc-4b77-b507-acd57cb27969/tlbexp-warning-about-ipicturedisp?forum = clr),解决方法是**将* stdole *的开关“Embed Interop Types”设置为false ***? –