Windows error 0x80131124, -2146234076

Detailed Error Information

CLDB_E_INDEX_NOTFOUND[1]

Message"Index not found."
Comment Index %s not found.

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 Code4388 (0x1124)

Questions

8votes
2answers

Create a copy of method from IL

I am trying to create a copy of a method during runtime using reflection. I have the following code. public static R CopyMethod<T, R>(Func<T, R> f, T t) { AppDomain currentDom = Thread.GetDomain(); AssemblyName asm = new AssemblyName(); asm.Name = "DynamicAssembly"; AssemblyBuilder abl = currentDom.DefineDynamicAssembly(asm, AssemblyBuilderAccess.Run); ModuleBuilder mbl = abl.DefineDynamicModule("Module"); [...] read more
c#
reflection
.net-assembly
reflection.emit
il
7votes
5answers

Can't Enable-Migrations. Throws System.BadImageFormatException: Could not load file or assembly

I can't enable EF migrations! Using the package manager console, it throws the following: PM> Enable-Migrations System.BadImageFormatException: Could not load file or assembly 'MyApp' or one of its dependencies. Index not found. (Exception from HRESULT: 0x80131124) File name: 'MyApp' ---> System.BadImageFormatException: Index not found. (Exception from HRESULT: 0x80131124) at System.Reflection.RuntimeAssembly._nLoad(AssemblyName [...] read more
entity-framework
asp.net-mvc-4
entity-framework-migrations
6votes
1answer

Calling varargs method via DynamicMethod

I'm trying to call unmanaged printf-like function using DynamicMethod. At runtime I get a > BadImageFormatException:Index not found. (Exception from HRESULT: 0x80131124) Is this a limitation of runtime or my emited code is wrong? public class Program { [DllImport("msvcrt40.dll",CallingConvention = CallingConvention.Cdecl)] public static extern int printf(string format, __arglist); static void [...] read more
c#
.net-4.0
cil
reflection.emit
dynamicmethod
4votes
3answers

What does BadImageFormatException 0x80131124 (Index not found) mean?

My program is occasionally crashing with the following error message: > System.Reflection.TargetInvocationException: Exception has been thrown by the > target of an invocation. ---> System.BadImageFormatException: Index not found. > (Exception from HRESULT: 0x80131124) Some details which may be relevant: * C# 4 / .NET 4 * Windows 7 64 bit [...] read more
.net
badimageformatexception
2votes
1answer

How can I call a method outside the executing assembly in MSIL?

I have access to a function body Intermediate Language like this : byte[] ilCodes = NestedFooInfo.GetMethodBody().GetILAsByteArray(); I am able to modify its IL code so that before executing the method body I call the following method named OnChangeField: public static void OnChangeField() { Console.WriteLine("VICTORY"); return; } So far I do [...] read more
c#
hook
clr
jit
cil
1vote
0answers

Assembly.LoadFrom fails but only sporadically

I want to write a program that watches a .dll for changes. When a change happens, it should load the assembly and invoke the foo function inside. I have some code that should implement this, but it behaves strangely. Sometimes it works. Sometimes the assembly it loads will be an [...] read more
.net-core
f#
.net-assembly
system.reflection
0votes
1answer

BadImageFormatException error on Azure web app

I have published my website as a Azure web application(through Visual Studio publish) and I am getting a An unhandled exception has occurred while executing the System.BadImageFormatException: Index not found. (Exception from HRESULT: 0x80131124) error. The application however works fine on my local machine. Between the time when the application [...] read more
c#
azure
asp.net-core
azure-web-app-service
razor-pages
0votes
1answer

Random errors when building solution

When building my solution, I randomly receive one of these errors: > C:\working_directory.nuget\NuGet.targets(91, 5): Type handle > 'NuGet.ProjectModel.LockFile' and method handle with declaring type > 'NuGet.ProjectModel.HashCodeCombiner' are incompatible. Get > RuntimeMethodHandle and declaring RuntimeTypeHandle off the same MethodBase. > C:\working_directory.nuget\NuGet.targets(91, 5): error MSB3073: The command > ""C:\working_directory.nuget\NuGet.exe" install > "C:\working_directory\Project_A\packages.config" [...] read more
c#
.net
nuget
0votes
0answers

Randomly getting 'System.BadImageFormatException: Index not found' error in Web API after certain deployments to an Azure App Service

I have an ASP.NET Web API application running on an Azure App Service which is, in turn, deployed via Octopus after a TFS build definition is completed. After certain successful deployments (no errors happen nor in TFS nor in Octopus), the whole API stops working and all endpoints respond with [...] read more
asp.net-web-api
tfs
azure-web-app-service
octopus-deploy
octopus
0votes
1answer

Add Migrations Issue - Could not load file or assembly 'TOMS.EntityFramework' or one of its dependencies. Index not found

I'm working on an existing solution which works fine all this while. After a few weeks, I tried to add a new migration to entity framework and got this error. All projects are currently set to build 'Any CPU'. I'm using Net 4.6.1 and Entity Framework 6.1.3 PM> Add-Migration AddedVerifyRemarks [...] read more
c#
asp.net-mvc
entity-framework
0votes
1answer

F# errors in Interactive but not in command line REPL

This is erroring when run in Visual Studio F# Interactive window, but not in the command line F# REPL or in Rider. let numbers = [1..10] let numberFilter number = number % 5 = 0 || number % 3 = 0 ;; error FS0193: internal error: Index not found. (Exception [...] read more
.net
visual-studio
f#
f#-interactive
0votes
0answers

XAML Designer stopped working - BadImageFormatException

I am having the following exception in visual studio xaml designer when trying to open a xaml file. System.BadImageFormatException Index not found. (Exception from HRESULT: 0x80131124) at Microsoft.MetadataReader.IMetadataAssemblyImport.GetAssemblyRefProps(Token token, EmbeddedBlobPointer& pPublicKey, Int32& cbPublicKey, StringBuilder szName, Int32 cchName, Int32& pchName, AssemblyMetaData& pMetaData, UnusedIntPtr& ppbHashValue, UInt32& pcbHashValue, AssemblyNameFlags& dwAssemblyRefFlags) at Microsoft.MetadataReader.AssemblyNameHelper.AssemblyNameFromRefBuilder.Fetch() at [...] read more
wpf
xaml
visual-studio-2015
xamlparseexception
0votes
0answers

Could not load file or assembly 'System.Web.Mvc' or one of its dependencies. Index not found

I have created a mvc4 web application. It works on my dev environment but when I deploy it to my production environment (WinHost) it generates following error. I have already changed copy Local to true > Could not load file or assembly 'System.Web.Mvc' or one of its dependencies. > Index [...] read more
asp.net-mvc-4
webgrease
0votes
1answer

Cannot Connect to SQL Server Express

I tried to connect to SQL Server 2012 Express through Visual Studio 2012. It was working before until yesterday when it gave this error > Cannot connect to FRANCISPEDS\SQLEXPRESS. > ADDITIONAL INFORMATION: The type initializer for > 'System.Data.SqlClient.SqlConnection' threw an exception. (System.Data) Minutes later, tried to connect again, now it [...] read more
visual-studio-2012
sql-server-2012-express
-1votes
2answers

Adding a call to a method before a STFLD causes an InvalidProgramException

I have access to a function body Intermediate Language like this : byte[] ilCodes = NestedFooInfo.GetMethodBody().GetILAsByteArray(); I want to be able to modify its IL code so that whenever there is a stfld IL command I call the following method named OnChangeField: public static void OnChangeField(object obj, object value) { [...] read more
c#
jit
cil

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