Pregunta

Cuando construyo la aplicación # MCInvoiceAddQBFC C del ejemplo de código SDK QuickBooks, la generación falla con

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?)

Mirando el Explorador de soluciones Veo que hay una señal de advertencia sobre Interop.QBFC8, lo que concuerda con la primera línea de advertencia en el resultado de generación. Hice instalar el SDK, y también he intentado eliminar y añadir la referencia otra vez. Alguna idea?

¿Fue útil?

Solución

aparentemente no se hace referencia a la DLL correctamente. No estoy familiarizado con el SDK de QuickBooks, pero si usted nota que su csc.exe línea, no hay ninguna referencia a ningún QuickBooks DLL.

Agregue la referencia adecuada en cada proyecto en su solución?

Editar es el Interop.QBFC ensamblaje aparece en el .NET pestaña cuando se elige Agregar referencia ... en el menú proyecto ? Compruebe que el archivo existe allí. Alternativamente, agregue una referencia a la DLL explícitamente por la navegación a la ruta que el archivo existe. Incluso se puede copiar el archivo DLL a su proyecto carpeta en primer lugar.

Editar Hacer referencia a una interfaz COM crea la Interop.XXX.dll dinámicamente. Si se añade QBFC8 como referencia COM, asegúrese de que se ve en la carpeta Referencias. Es posible que tenga que cambiar a using Interop.QBFC8; using QBFC8;. La primera cosa que noté, como he mencionado era que su csc.exe línea no muestra la referencia adecuada. Aquí está la línea cuando construyo un proyecto con una referencia COM diferente:

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

Si usted no está viendo la /reference:obj\Debug\Interop.XXX.dll, es necesario mirar a sus referencias de nuevo.

Otros consejos

Creo que es necesario agregar una referencia a

C:\Program Files\Common Files\Intuit\QuickBooks\Interop.QBFC8.dll
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top