QuickBooks:未解决的SDK参考?

QuickBooks:未解决的SDK参考?

问题描述:

当我构建样本QuickBooks的SDK代码的MCInvoiceAddQBFC C#应用程序,构建失败,QuickBooks:未解决的SDK参考?

C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning MSB3245: Could not resolve this reference. Could not locate the assembly "Interop.QBFC8, Version=8.0.0.28, Culture=neutral, PublicKeyToken=31d8aec643e18259". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. 

C:\Windows\Microsoft.NET\Framework\v2.0.50727\Csc.exe /noconfig /nowarn:1701,1702 /platform:x86 /errorreport:Prompt /warn:4 /define:DEBUG;TRACE /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Vsa.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Deployment.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Design.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Security.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Web.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /debug+ /debug:full /optimize- /out:obj\Debug\MCInvoiceAddQBFC.exe /resource:obj\Debug\MCInvoiceAddQBFC.Form1.resources /resource:obj\Debug\IntuitQBFC.Properties.Resources.resources /target:winexe Form1.cs Form1.Designer.cs Program.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs Properties\Settings.Designer.cs SessionFramework\Defaults.cs SessionFramework\ENEdition.cs SessionFramework\Logger.cs SessionFramework\QBException.cs SessionFramework\QBNoResponseException.cs SessionFramework\QBResultException.cs SessionFramework\SessionManager.cs 

C:\Users\ESSEFF\Documents\Visual Studio 2005\Projects\MCInvoiceAddQBFC\Intuit_QBFC\Form1.cs(12,7): error CS0246: The type or namespace name 'Interop' could not be found (are you missing a using directive or an assembly reference?) 

C:\Users\ESSEFF\Documents\Visual Studio 2005\Projects\MCInvoiceAddQBFC\Intuit_QBFC\SessionFramework\SessionManager.cs(11,7): error CS0246: The type or namespace name 'Interop' could not be found (are you missing a using directive or an assembly reference?) 

在解决方案资源管理器找我看到有关于Interop.QBFC8的警告标志,这与第一警戒线同意在构建输出中。我确实安装了SDK,我也尝试再次删除并添加参考。任何想法?

你显然没有正确引用该DLL。我不熟悉QuickBooks SDK,但是如果您注意到您的csc.exe行,则没有任何QuickBooks dll的引用。

您是否在解决方案中的每个项目中添加了适当的参考?

编辑:是在.NET选项卡下,当你选择从项目菜单中选择添加引用...的Interop.QBFC组装?检查文件是否存在。或者,通过浏览到该文件存在的路径,明确添加对DLL的引用。您甚至可以先将DLL复制到您的项目文件夹中。

编辑:引用COM接口动态地创建Interop.XXX.dll。如果添加QBFC8作为COM参考,请确保您在参考文件夹中看到它。您可能需要将using Interop.QBFC8;更改为using QBFC8;。我注意到的第一件事,正如我提到的那样,您的csc.exe行不显示正确的引用。这里是线的时候我建立了一个项目,不同的COM参考:

C:\Windows\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" 
    /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" 
    /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll 
    /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Deployment.dll 
    /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll 
    /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll 
    /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll 
    /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll 
    /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" 

    /reference:obj\Debug\Interop.COMSVCSLib.dll 

    /debug+ /debug:full /filealign:512 /optimize- 
    /out:obj\Debug\WindowsFormsApplication1.exe 
    /resource:obj\Debug\WindowsFormsApplication1.Form1.resources 
    /resource:obj\Debug\WindowsFormsApplication1.Properties.Resources.resources /target:winexe 
    Form1.cs Form1.Designer.cs Program.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs Properties\Settings.Designer.cs 

如果你没有看到/reference:obj\Debug\Interop.XXX.dll,你需要在你的介绍人再看看。

+0

如果部署是一个问题,和您收到客户端上的错误,其他人可能有过类似的问题:HTTP://社会。 msdn.microsoft.com/forums/en-US/winformssetup/thread/50ca7296-4a59-4c2c-8c8e-abe40ff4ba21/ – maxwellb 2010-06-18 19:48:37

+0

你的意思是Project-> Add Reference?实际上,我正在谈论SDK示例代码,所以我期望仅仅打开该项目并构建它就行了。我曾尝试创建一个新项目,从SDK中添加COM参考,然后编写一个'使用Interop.QBFC8;'。这导致了类似的参考错误未解决。 – esseff 2010-06-18 19:50:21

+0

部署不是问题 - 但。我在我自己的机器上本地工作,我甚至无法获取要构建的示例代码。 – esseff 2010-06-18 19:51:48

我相信你需要添加一个引用到

C:\Program Files\Common Files\Intuit\QuickBooks\Interop.QBFC8.dll