3

サンプル QuickBooks SDK コードの MCInvoiceAddQBFC C# アプリケーションをビルドすると、ビルドが失敗します。

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をインストールしましたが、参照を削除して再度追加しようとしました。何か案が?

4

2 に答える 2

4

どうやらDLLを正しく参照していません。私はQuickBooksSDKに精通していませんが、csc.exe行に気付いた場合、QuickBooksdllへの参照はありません。

ソリューションの各プロジェクトに適切な参照を追加しましたか?

編集:プロジェクトメニューから[参照の追加... ]を選択すると、[。 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、参照をもう一度確認する必要があります。

于 2010-06-18T19:39:01.527 に答える
0

私はあなたがへの参照を追加する必要があると信じています

C:\Program Files\Common Files\Intuit\QuickBooks\Interop.QBFC8.dll
于 2010-06-19T05:29:28.460 に答える