in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

"Targets Different Processor than Application" - Error Message

Last post 12-08-2006 8:47 AM by JazzBass. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 12-01-2006 1:09 PM

    "Targets Different Processor than Application" - Error Message

    Hello!  I'm using VB Express 2005 on XP w/ Intel P4 processor

    I've recently noticed this error when I try to build my project

    Warning    1    Referenced assembly 'C:\Program Files\SQLite.NET\bin\System.Data.SQLite.dll' targets a different processor than the application.

    I was using 1.0.38 and I thought it was just that version, so I uninstalled it and installed 1.0.36, but I still have the same problem.  I'm using your binaries from Sourceforge.net

    My application works fine, other than that error message.  Is there something I need to reset or change on my end to get that message to go away?

    Thanks very much for the help and the awesome tool!
    JB
  • 12-01-2006 9:11 PM In reply to

    • Deus
    • Top 50 Contributor
    • Joined on 08-03-2006
    • Posts 23

    Re: "Targets Different Processor than Application" - Error Message

    64 bit Windows?
  • 12-03-2006 9:04 AM In reply to

    Re: "Targets Different Processor than Application" - Error Message

    Sorry about that.  I knew I forgot something.

    No, 32bit XP.

    JB
  • 12-06-2006 12:26 AM In reply to

    Re: "Targets Different Processor than Application" - Error Message

    Well, all you can really do is verify you're referencing the right assembly in your project ... the warning itself should be harmless.

    Robert

     

  • 12-08-2006 7:55 AM In reply to

    Re: "Targets Different Processor than Application" - Error Message

    Cool.  Yeah, as far as I know, I'm referencing the right one.  Other than adding the reference under the 'Add Reference' dialog, is there any other place I can double check?  As I posted originally, it's looking at the .dll under the main 'bin' directory, not 'bin\x64'.

    Thanks very much!
    JB
  • 12-08-2006 8:47 AM In reply to

    Re: "Targets Different Processor than Application" - Error Message

    Just a FYI, I think I found something that will help eliminate the error message.  Like you said, it doesn't sound serious and this doesn't quite fit totally, but in principle, it close to the same issue.

    Taken from: http://msdn.microsoft.com/vstudio/express/support/issues/

    1.3 References to 32-bit COM components may not work in VB and C# Applications running on 64-bit platforms

    Most existing COM components are only available for 32-bit platforms and will not run in a 64-bit process on a 64-bit platform (although they will run correctly in a 32-bit process on a 64-bit platform). VB and C# applications that reference these 32bit COM components will not run by default on a 64-bit platform because by default the application will launch as a 64-bit process.

    The problem appears when a project with one or more COM references is:

    1. Migrated to VS 2005 and executed on 64 bit platforms
      -or-
    2. Created using VS 2005 on 64 bit platforms

    In VS 2005 the VB and C# compilers use the platform target property to determine if the.exe or .dll should run in 32 bit or 64 bit CPU architecture mode. The default setting for this property in Visual Studio 2005 is set to 'AnyCPU' which indicates that the application can run in either 32 and 64 bit mode, depending on the host platform. In this situation you may see an error such as "Cannot instantiate class …" when you debug or run these applications.

    To resolve this issue

    Set the platform target property to 'X86' for your VB or C# projects that have references to COM components.

    For C# Projects:

    1. Right click the project in the solution explorer and open 'properties'
    2. Choose the Build tab
    3. Set the Platform Target property to 'X86'

    For VB Projects:

    1. Right click the project in the solution explorer and open 'properties'
    2. Choose the Compile tab
    3. Press the Advanced Compile Options… button
    4. Set the Target CPU property to 'X86'

    Express Edition:

    The VB and C# Express products to not expose the Target property inside the development environment. You will need to carefully modify the project file using a text or XML editor.

    1. Close the project and/or solution
    2. Select Open File from the File menu
    3. Navigate to the project directory, and highlight the project file
    4. Press the Open button, the project file should open in the XML editor

    Locate the first <PropertyGroup> section and add the following line: <PlatformTarget>x86</PlatformTarget>

    1. Save the project file
    2. Reopen the project and/or solution using Open Project/Solution from the File menu
    3. Continue with development, debugging, and testing

    Alternatively, if the application is targeted to 64-bit platforms, you can ensure that the COM controls added to the application have 64-bit equivalents on the development and deployment computers.

    I have tried adding the <Platform> tag to my project file in VB Express and it worked for me.

    Hope this helps others.

    JB
Page 1 of 1 (6 items)
Powered by Community Server (Commercial Edition), by Telligent Systems