locked
Invalid assembly platform or ContentType in file RRS feed

  • Question

  • Hi,

    I have an application that is calling another app (dll). Within this second dll is a reference to System.Data.dll

    However, I get the error "ERR: Invalid assembly platform or ContentType in file (hr = 0x8007000b)." in FusionLog...

    I tested by trying to use the 64bit System.Data dll in Visual Studio 2010 but VS manages to use the 32bit one (C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll)

    What do I need to update for this to work?

    Thanks!

    *** Assembly Binder Log Entry  (03/03/2016 @ 16:15:58) ***
    
    The operation failed.
    Bind result: hr = 0x8007000b. An attempt was made to load a program with an incorrect format.
    
    Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
    Running under executable  C:\Program Files (x86)\Advent\Geneva\WFM\WorkflowManager.exe
    --- A detailed error log follows. 
    
    === Pre-bind state information ===
    LOG: Where-ref bind. Location = C:/Windows/Microsoft.NET/Framework/v2.0.50727/System.Data.dll
    LOG: Appbase = file:///C:/Program Files (x86)/Advent/Geneva/WFM/
    LOG: Initial PrivatePath = NULL
    LOG: Dynamic Base = NULL
    LOG: Cache Base = NULL
    LOG: AppName = WorkflowManager.exe
    Calling assembly : (Unknown).
    ===
    LOG: This bind starts in LoadFrom load context.
    WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
    LOG: Using application configuration file: C:\Program Files (x86)\Advent\Geneva\WFM\WorkflowManager.exe.Config
    LOG: Using host configuration file: 
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
    LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/System.Data.dll.
    LOG: Assembly download was successful. Attempting setup of file: C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll
    LOG: Entering run-from-source setup phase.
    LOG: Assembly Name is: System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    ERR: Invalid assembly platform or ContentType in file (hr = 0x8007000b).
    ERR: Run-from-source setup phase failed with hr = 0x8007000b.
    ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.

    Thursday, March 3, 2016 6:00 PM

Answers

  • Hi obrienkev,

    Have you solved your issue? When creating a new project, you should choose the project’s .NET Framework version as shown in the following picture.

    The version of the System.Data.dll is decided by the project’s .NET Framework version as shown in the following image.

    >>How do I tell if this Win service is 32bit or 64bit?

    If you want to check the platform of a windows service, please check it in task manager as following screenshot shows. If you cannot find Platform column in task manager, you could right click the column name, and then click “select column” to get Platform option.

    Best Regards,

    Albert Zhang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Edited by Albert_Zhang Monday, March 21, 2016 3:18 AM
    • Marked as answer by DotNet Wang Monday, March 21, 2016 3:19 AM
    Friday, March 11, 2016 10:06 AM

All replies

  • Hi obrienkev,

    Please try to test with 'Any CPU' and build again.

    Here is also a similar thread

    http://forums.asp.net/t/2006795.aspx?Could+not+load+file+or+assembly+file+or+one+of+its+dependencies+The+system+cannot+find+the+file+specified

    Op resolved with embedded resources. hope also give you some hints.

    In addition, what's your project type? Is it Asp.Net web project?

    Best regards,

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, March 4, 2016 6:57 AM
  • Hi,

    I had already built it with 'Any CPU'.

    The reference is in an embedded xsl file...

      <msxsl:script language="C#" implements-prefix="userCSharp">
        <msxsl:assembly href="C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll" />
        <msxsl:using namespace="System.Data" />
        <![CDATA[

    The dll is called from a Windows service. How do I tell if this Win service is 32bit or 64bit?

    Thanks!

    Friday, March 4, 2016 9:00 AM
  • Hi obrienkev,

    Have you solved your issue? When creating a new project, you should choose the project’s .NET Framework version as shown in the following picture.

    The version of the System.Data.dll is decided by the project’s .NET Framework version as shown in the following image.

    >>How do I tell if this Win service is 32bit or 64bit?

    If you want to check the platform of a windows service, please check it in task manager as following screenshot shows. If you cannot find Platform column in task manager, you could right click the column name, and then click “select column” to get Platform option.

    Best Regards,

    Albert Zhang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Edited by Albert_Zhang Monday, March 21, 2016 3:18 AM
    • Marked as answer by DotNet Wang Monday, March 21, 2016 3:19 AM
    Friday, March 11, 2016 10:06 AM
  • I didn't know about Platform in the Task Manager... thanks!
    Saturday, August 17, 2019 2:16 AM