Windows error 0x80131018, -2146234344

Detailed Error Information

COR_E_ASSEMBLYEXPECTED[1]

Message"The module was expected to contain an assembly manifest."
Comment The module was expected to contain an assembly manifest.

HRESULT analysis[2]

FlagsSeverityFailure
Reserved (R)false
OriginMicrosoft
NTSTATUSfalse
Reserved (X)false
FacilityCode19 (0x013)
NameFACILITY_URT[2][3]
DescriptionThe source of the error code is .NET CLR.[2][3]
Error Code4120 (0x1018)

Questions

13votes
1answer

Native Assembly Binding fails for ASP.NET solution

NOTE: This main purpose of the question to UNDERSTAND/EXPLAIN the assembly binding behavior of the CLR. The solution should be evident once the reason is pinned down. Please, know that I understand my setup is not optimal (nativedll not signed and versioned etc) but again I just want to investigate [...] read more
c#
asp.net
clr
11votes
6answers

Reading the Version number from a AssemblyInfo.cs file

I'm trying to extract the version number from a AssemblyInfo.cs file! And I'm trying to use System.Reflection.Assembly.LoadFile(path); But while doing this I get a BadImageFormatException; "The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018)". So now I wounder, is that not a possible way to go [...] read more
c#
c#-4.0
11votes
2answers

MEF Parts not found for deployed app, but found in Debug mode

I checked a lot of MEF questions here but I can't imagine what my problem is. Here's what's happening: I have a desktop WPF app that I'm deploying with AdvancedInstaller. I use .NET 4.0 and MEF to compose parts. Some parts are in the main project, so they are inside [...] read more
wpf
dll
plugins
mef
catalog
8votes
5answers

Loading an assembly generated by the Roslyn compiler

I'm generating a Greeter.dll using the Roslyn compiler. My problem occurs trying to load the DLL file. Here's the code: using System; using Roslyn.Compilers; using Roslyn.Compilers.CSharp; using System.IO; using System.Reflection; using System.Linq; namespace LoadingAClass { class Program { static void Main(string[] args) { var syntaxTree = SyntaxTree.ParseCompilationUnit(@" class Greeter { [...] read more
c#
assemblies
roslyn
7votes
1answer

64 bit managed assembly with unmanaged dependencies not loading in IIS / ASP.NET MVC 4

I have an almost empty ASP.NET MVC4 project referencing a 64 bit managed assembly, which has a set of unmanaged dependencies. The managed assembly is referenced the normal way through references. The unmanaged dependencies are copied to the bin folder on a post build event - and are present when [...] read more
asp.net
64-bit
unmanaged
iis-8
6votes
4answers

Could not load file or assembly in VS2017 with IIS express

We have a ASP.NET project in the company that runs for 5/6 developers. All Visual Studio 2017 and debug on IIS Express, no crazy setting or anything to make it run. 1 colleague cannot get it to work, he always gets the following exception: enter image description here [https://i.stack.imgur.com/MsOBz.png] We [...] read more
visual-studio
iis-express
5votes
1answer

How to use method from VB6 dll in .NET?

I have ActiveX VB6 DLL (have no access to its sources), and want to call method 'GetUnitInfo' I use to import it like: [DllImport(@"C:\Users\R\Documents\lab.dll")] public static extern long GetUnitInfo(String strRequest, String strInfo, String strName); But I get an exception: > Unable to find an entry point named 'GetUnitInfo' in DLL [...] read more
c#
vb.net
vb6
dllimport
5votes
7answers

BadImageFormatException encountered with WcfSvcHost and IIS WCF host

Creating a WCF Service Library in Visual Studio 2008 on Vista x64 is troublesome when referencing an x86 DLL. A service that calls a 32-bit DLL is required to have a platform target of x86 to run on a 64-bit OS. When you do this, the WcfSvcHost throws a BadImageFormatException [...] read more
c++
wcf
interop
iis-6
was
4votes
2answers

Exception occurred while initializing the installation: System.BadImageFormatException: Could not load file or assembly

I have Worker Services as Windows services which I am trying to install on a machine however it throws the below error when I try Installing it Microsoft (R) .NET Framework Installation utility Version 4.8.3752.0 Copyright (C) Microsoft Corporation. All rights reserved. Exception occurred while initializing the installation: System.BadImageFormatException: Could [...] read more
c#
asp.net-core
.net-core
4votes
1answer

Assembly.LoadFile() throws exception about missing manifest

The exception is: The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018) I get it at the line: Assembly lvAssembly = Assembly.LoadFile(aPathFileName); The file being loaded is a plugin that is generated by a different application. If I changed the Target Framework Version of the plugin [...] read more
c#
3votes
2answers

Dynamically loading unmanaged OCX in C#

I have ocx created in VC++ If it is loaded statically it works fine but when I load it dynamically from assembly it gives exception . public Assembly assembly; public Form1() { InitializeComponent(); assembly = Assembly.LoadFile(Application.StartupPath + "\\abc.ocx"); } it gives following exception The module was expected to contain an [...] read more
c#
ocx
2votes
2answers

SQL2008R2 install issues on windows 7 - unable to install setup support files?

I am trying to install the above but am getting the following errors when its attempting to install the setup support files, This is the first error that occurs during installation of the setup support files TITLE: Microsoft SQL Server 2008 R2 Setup ------------------------------ The following error has occurred: The [...] read more
sql-server-2008
installation
2votes
0answers

How to load in Powershell a DLL that is missing a manifest

These lines: "[Environment]::Is64BitProcess" "[Reflection.Assembly]::LoadFile("C:\MvxAPI\MvxSockx64.dll") " gives these results: True Exception calling "LoadFile" with "1" argument(s): "The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018)" At C:\GitRepo\PowerShellScripts\ApiDllTest.ps1:11 char:1 + [Reflection.Assembly]::LoadFile("C:\MvxAPI\MvxSockx64.dll") + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : BadImageFormatException The DLL is supplied [...] read more
powershell
dll
2votes
1answer

System.BadImageFormatException for Microsoft.AspNetCore.Hosting

It seems I've somehow managed to corrupt my machine's .NET Core installation. I am unable to run any basic ASP.NET Core application. Instead the following error occurs: > System.BadImageFormatException occurred > > HResult=0x80131018 > > Message=Could not load file or assembly 'Microsoft.AspNetCore.Hosting, > Version=1.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The module > was [...] read more
c#
.net
iis
asp.net-core
.net-core
2votes
2answers

Cannot load assembly (hr = 0x80131018)

I have a user with issues loading a .Net assembly into AutoCAD. I get the following error: > Cannot load assembly. Error details: System.BadImageFormatException: Could not > load file or assembly (hr = 0x80131018) They are using an anit virus package called Endpoint Security and when this is turned off, [...] read more
.net
assemblies
autocad
2votes
0answers

Issue adding some non dev .dll files to a WiX Installer

I'm fairly new to WiX and I have been trying to create an installer for some software my team has been working on. The installer worked well until the customer asked us to include some of their own .dll files in the installer, up to this point we had left [...] read more
c#
wix
2votes
0answers

TeamCity can not start MSTest.exe or vstest.console.exe

I am getting this error when I try to run unit tests via teamcity MyTeamCity version is 9.1 and I am using Visual Studio 2015. If I change the name of MSTest.exe or vstest.console.exe it throws another error about finding the files. Also I think the problem is not about [...] read more
visual-studio-2015
teamcity
mstest
teamcity-9.0
vstest.console.exe
2votes
1answer

Why would adding a reference to a DLL fail on one of two computers of the same operating system/configuration?

I have two computers that are both W7-64. I am attempting to prepare the second computer (PC) to execute an IronPython automation suite that was built on the first computer (Master). Currently, PC is failing when scripts reach the following line: clr.AddReferenceToFileAndPath(Path.GetFullPath(r"C:\analyst_test\bin\Debug\Win32API.dll")) Output: SystemError: The module was expected to contain [...] read more
ironpython
dllimport
pywin32
2votes
1answer

WiX adding .net files to GAC

I have a problem copying assembly files to GAC using msi installer file. My project requires me to add some .netmodule files along with a .dll file to GAC. But using the assembly = ".net" for .netmodule file in the <File> element is throwing an error(build error). Error 2 The [...] read more
wix
gac
wix3.6
2votes
3answers

Assembly loading problem

I have an assembly loading problem that's cropping up when I convert from Vista (32bit) to Windows 7 (32bit). It occurs when I try to load some very old Sybase ASE ADO.NET data provider DLLS. The log from the fusion log viewer shows this: *** Assembly Binder Log Entry (18/01/2010 [...] read more
.net
assemblies
runtime-error
2votes
1answer

BadImageFormatException - Is it possible to specify which .NET version is used to run an executable?

I'm running a .NET 2.0 executable with a .com extension from a command line and receiving the following error: System.BadImageFormatException : The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018) I'm pretty sure it's trying to load a DLL from the .NET 2.0 Global Assembly Cache. [...] read more
.net
2votes
2answers

C# getting version of unmanaged dll

I'm calling an unmanaged dll from my managed c# code and wanted to check I'm calling the right version. The code I'm trying to load the assembly (to then get the resource file and then get the version) is: cur_version = Assembly.LoadFile("X:\Workspace\yreceipts_pos\yRprintProcessor\Debug\yRprintProcessor.dll"); It's failing because of this error: The module [...] read more
c#
unmanagedresources
1vote
0answers

The module was expected to contain assembly manifest JNI4net error

I am trying to load XceedZip.dll in java using JNI4net/proxygen. when proxygen command is executed I am getting Could not load file or assembly 'file:///C:\Eclipse\JNITest\JNI\XceedZip.dll' or one of its dependencies. The module was expected to contain an assembly manifest. Please find below the binder log entry *** Assembly Binder Log [...] read more
.net
jni4net
1vote
0answers

IronPython integration with .net API

I am working on an API integration with a web app. The API is written in Microsoft .Net Framework. I was able to get the API working through an C# application, but I would like to migrate this to python so I can use this within my web application. I [...] read more
python
ironpython
1vote
0answers

Import librairy like JSON or XML for python, with IronPython on C# App

I am trying to execute a Python Script on a C# Application. So I choose Iron Python, I have managed to execute basic code. But while using libraries like xml or json. I cannot import and use them. I've tried a lot,but nothing works out. The main thing which I [...] read more
c#
python
xml
wpf
ironpython
1vote
0answers

Powershell fails to load DLL because manifest is missing

These statements: [Environment]::Is64BitProcess [Reflection.Assembly]::LoadFile("C:\MvxAPI\MvxSockx64.dll") Generate: True Exception calling "LoadFile" with "1" argument(s): The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018) At C:\GitRepo\PowerShellScripts\ApiDllTest.ps1:11 char:1 + [Reflection.Assembly]::LoadFile("C:\MvxAPI\MvxSockx64.dll") + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : BadImageFormatException From a PowerShell program I've written, I [...] read more
powershell
dll
1vote
0answers

BadImageFormatException in mscorlib.dll. The module was expected to contain an assembly manifest

i am trying to call some third party c# dll's from C++ program. In stand alone c# program everything works fine without exception. When running C++/CLI I get an exception "BadImageFormatException in mscorlib.dll" Could not load file or assembly "MyTestAppCpp.exe" or one of its dependencies. The module was expected to [...] read more
c#
c++
dll
c++-cli
1vote
2answers

Does Kentico 10 use a different strategy for assembly loading/probing/handling than previous versions?

We have what seems to be a assembly loading or probing difference driven by Kentico 10 (compared to 9 and earlier) that I'm trying to understand, so I can troubleshoot assembly load errors, my current example being the following... > Example: We've been using Expert PDF components in websites from [...] read more
clr
kentico
probing
1vote
0answers

How are non-CLR dependencies resolved in C#?

I have a DLL written in C called amzi.dll, and a wrapper DLL written in Managed C++ called amzinet.dll. amzinet.dll calls amzi.dll. In my C# project I have added amzinet.dll as a reference and as per the requirement, copied the non-CLR DLL amzi.dll to the bin directory of my application. [...] read more
c#
c++
dll
1vote
1answer

msvcp120.dll and msvcr120.dll files breaking my app After nReco.PdfGenerator adds to my bin directory

I have an asp.net mvc web application working fine before I upgraded nreco.pdfgenerator to version 1.1.10. After upgrading to version 1.1.10, whenever a pdf file is generated, the application stops working and just displays the message Server Error in '/' Application. Could not load file or assembly 'file:///C:\Projects\bin\msvcp120.dll' or one [...] read more
wkhtmltopdf
msvcr120.dll
1vote
2answers

Cannot connect to Team Foundation Server in Visual Studio 2012 after update 4

I installed Visual Studio 2012 Update 4 (downloaded from MS download center) and lost the connection to Team Foundation Server from Team Explorer. Before that, I was connected right at VS2012 startup. It is not the case anymore and I cannot connect to Team Foundation Server from any entry in [...] read more
visual-studio-2012
1vote
1answer

ASP.NET Error, GAC Corrupted

I am developing ASP.NET web application (C#). When I rebuild my solution, the process very slow than before. And I got this error. The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018) Description: An unhandled exception occurred during the execution of the current web request. Please [...] read more
c#
asp.net
visual-studio-2008
windows-7
1vote
2answers

Multilingual Applications in .NET

I am a newbie for C#, although I have several years of experience with OOP. For a project in the design phase, I was chosen to find out how multilinguality can be done under C#. For the project, I am currently using Microsoft Visual Studio 2010 Express... What I have [...] read more
c#
.net
multilingual
1vote
1answer

C# calling a MASM Assembly DLL

For the sake of learning, I'm trying to call an Assembly function from C#. I'm working in a very sterile project doing everything as simply as I can. Here's my assembly (mostly cut and paste from codeproject): .386 .model flat, stdcall option casemap :none include \masm32\include\masm32rt.inc .code LibMain proc instance:dword,reason:dword,unused:dword [...] read more
c#
interop
masm
0votes
0answers

Fitnesse Slim runner cannot load .net 5 assembly: Error extracting manifest import from file (hr = 0x80131018)

Running a test in Fitnesse gives: > Could not complete testing: fitnesse.slim.SlimError: Error SLiM server died > before Header Message could be read. When using Slim RunnerW.exe to debug my test I get an exception: > System.BadImageFormatException: Could not load file or assembly > 'file:///c:\path\assemby.exe' or one of its dependencies. [...] read more
.net-core
.net-5
fitnesse-slim
fitsharp
0votes
0answers

Could not load file or assembly XXX or one of its dependencies. The module was expected to contain an assembly manifest

I am new to .net, I was developing a payment API and it is working fine if I run this application from Visual Studio, but once published to IIS its not working. All the dll files are there in the bin folder. Can anyone help to resolve this? Please find [...] read more
c#
asp.net
.net
asp.net-mvc
0votes
0answers

Redemption64.dll have nor manifest

Error Loading: c:\users\tigran\source\repos\voyagerbuild\processor\blocks\Redemption64.dll. Reason: System.BadImageFormatException: The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018) How can i create RdoSession with help interop.Redemption? There is this example set Session = CreateObject("Redemption.RDOSession") but i have not CreateObject method read more
manifest
outlook-redemption
0votes
1answer

Embedding SQLite.Interop.dll in C#

I have an application that has all the DLL files it needs embedded into it so that it is a standalone exe. Here is how I am loading everything now: public static Assembly ExecutingAssembly = Assembly.GetExecutingAssembly(); public static string[] EmbeddedLibraries = ExecutingAssembly.GetManifestResourceNames().Where(x => x.EndsWith(".dll")).ToArray(); public static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs [...] read more
c#
sqlite
embedded-resource
0votes
2answers

Call exported functions from C++ DLL library in C#

I have no problems to call C++ DLL functions from C# by using dynamic linking, but got problem when I tried to make it in dynamic way: Trying to get DLL handler: var DLL = Assembly.LoadFile(@"C:\project\mydll.dll"); And got exception: > An unhandled exception of type 'System.BadImageFormatException' occurred in > mscorlib.dll [...] read more
c#
c++
dll
0votes
1answer

It was expected that the module will contain the assembly manifest (hr = 0x80131018)

I have a problem with my project. My project had a target framework 4.5.1 and everything worked fine. I changed my project's target framework to 3.5 and got problems. Firstly I had to change some code (ex. Task replace with Thread, etc.) When there was no more errors I decided [...] read more
c#
.net
reference
runtime-error
.net-assembly
0votes
1answer

Trying to integrate user-made Bug Reports for TFS; issue with WITDataStore.dll

So from what I can gather online, to be able to save items to a TFS project, all you need to do is reference Microsoft.TeamFoundation.Client and Microsoft.TeamFoundation.WorkItemTracking.Client. So, I run my code and have those files copy to my bin (because you have to get them from the Visual Studio [...] read more
c#
.net
asp.net-mvc-4
tfs
visual-studio-sdk
0votes
1answer

Non-Assembly DLL in bin

We are trying to use WebSupergoo's ABCpdf .NET v10. And it works great if we use their installer. But v8 is already installed on the server with other projects using it, so we do not want to run the installer at this time. (Hopefully in the near future we can [...] read more
manifest
assemblies
abcpdf
badimageformatexception
0votes
0answers

How to put a DLL in the Bin folder of a web application published in Windows Azure without referencing it?

This question seems weird but weird problems often require weird solutions. I'm having a problem with Windows Azure and SignalR. As I described here, the assembly System.EnterpriseServices.Wrapper.dll is not being found and my application is crashing from time to time. I cannot explicitely add a reference to System.EnterpriseServices.Wrapper.dll. Visual Studio [...] read more
.net
azure
0votes
2answers

Load a com DLL in c#

I want to load a COM dll dynamically in c# console application. Till now I have tried the following code: // load exe with args as EXE DllName classNameTobeLoaded try { // load assembly Assembly Dll = Assembly.LoadFile(@"C:\My_Dir\TestComDll.dll"); // get the type names foreach(Type t in Dll.GetExportedTypes()) { dynamic vClassLoaded [...] read more
c#
.net
dll
com
0votes
1answer

Could not load file or assembly '\bin\ABCpdf8-64.dll' or one of its dependencies. The module was expected to contain an assembly manifest

I have getting the following error message when I try to run the application. Could not load file or assembly 'bin\ABCpdf8-64.dll' or one of its dependencies. The module was expected to contain an assembly manifest. Please find below full details from FusionLog Viewer <meta http-equiv="Content-Type" content="charset=unicode-1-1-utf-8"><!-- saved from url=(0015)assemblybinder: --><html><pre> [...] read more
asp.net-mvc-4
abcpdf
0votes
0answers

VS2012 Error while trying to run project

when i try to run an application i've created using VS2012 it gives me an "Error while trying to run project: Could not load file or assembly". And ive try to look on the vs log fuslogvw. This log report was given to me. I really dont know whats wrong [...] read more
c#
.net
visual-studio
visual-studio-2012
0votes
1answer

System.Data assembly binding failure after visual studio 2012 installation

After having installed visual studio 2012 on clear windows 7 machine i've issues running such applications as powershell,eventviewer and sql server setup. In FusionLogViewer there are logs for failed binding for assembly System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 for powershell with error code hr = 0x80131018. Does anyone know how to fix [...] read more
c#
.net
visual-studio-2012
0votes
1answer

XSocket's Plug-in Framework not working: I cannot get an instance of IXSocketServerContainer

I have following code to start my server: private static IXSocketServerContainer server = null; public SocketServer() { server = XSockets.Plugin.Framework.Composable.GetExport<IXSocketServerContainer>(); } this worked fine for me under WinXP and Win7, with exactly the same set of dll and exe files, but now I deployed my system under WinServer 2008 and [...] read more
c#
websocket
xsockets.net
0votes
2answers

Error running code from DLL in C#

I can't seem to get past this error, so I'm wondering if I'm doing anything wrong in my call code, or my DLL? -Error- $exception {System.BadImageFormatException: The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018) -call code- Assembly assembly = Assembly.LoadFile(@"C:\Users\Admin\Documents\Visual Studio 2012\Projects\MyDLL\Release\myDLL.dll"); Type type = [...] read more
c#
visual-studio
dll
dllimport
0votes
1answer

Import Library with special character in IronPython

I got a C++.NET library from a colleague with a name like "my-name.dll". Importing in IronPython is not possible since "from my-name import *" is not valid. If I rename the library to "myname.dll" I get an error that the assembly manifest is missing (HRESULT: 0x80131018). Now I'm not sure [...] read more
dll
character
ironpython
.net-assembly
0votes
1answer

WPF application fail to load C++ dll

I hava a WPF application which uses both C# and C++ dlls. On most machines it works properly but I have a few machine which when trying to run the application on them it I get the exception: The module should contain an assembly manifest. (HRESULT:0x80131018) I have no idea [...] read more
c#
c++
.net
wpf
dll
0votes
1answer

SharePoint 2010 central administration site error

I have just come to revisit an old virtual sharepoint 2010 install. When I crank up central administration I get the following error: The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018) Line 379: <compilation batch="false" debug="false"> Line 380: <assemblies> Line 381: <add assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, [...] read more
sharepoint
sharepoint-2010
assemblies
admin
gac
0votes
4answers

Simple asp.net precompilation issue in IIS

Looks like I am struck with a simple issue. I am hosting a precompiled website. It compiles and works fine in my local box. But when I host in IIS it fails with following error. Could not load type 'MyHero.Home1'. <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Home.aspx.vb" Inherits="MyHero.Home1" %> I can find [...] read more
asp.net
iis
precompiled-headers
precompiled
-1votes
1answer

Specflow feature.cs file throws 'BadImageFormatException' when auto-generating code

After upgrading to Specflow 2.3.2, feature.cs file generated following error message when changing feature file > Unhandled Exception: System.BadImageFormatException: The module was expected > to contain an assembly manifest. (Exception from HRESULT: 0x80131018) at > System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence) at > System.Reflection.Assembly.LoadFile(String path) at > TechTalk.SpecFlow.VisualStudio.CodeBehindGenerator.CommandLineHandling.PreLoadAssemblies() > at > TechTalk.SpecFlow.VisualStudio.CodeBehindGenerator.CommandLineHandling.PreLoadAssemblies() [...] read more
c#
visual-studio
specflow
-1votes
1answer

Trying to utilize cards.dll on 64-bit Windows 10

I am trying to utilize the "cards.dll" module to create a visual card game, and I can't seem to figure it out despite all of the Googling I can think to do. I have the DLL file (203,024 bytes) but I'm confused about the "registration" as a .NET or a [...] read more
c#
.net-assembly

Comments

Leave a comment

(plain text only)

Sources

  1. https://github.com/dotnet/coreclr/blob/v1.1.0/src/inc/corerror.xml
  2. https://msdn.microsoft.com/en-us/library/cc231198.aspx
  3. winerror.h from Windows SDK 10.0.14393.0

User contributions licensed under CC BY-SA 3.0