Windows error 0x80131522, -2146233054

Detailed Error Information

COR_E_TYPELOAD[1]

Message"Could not find or load a type."
Comment Could not find or load a specific type (class, enum, etc).

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 Code5410 (0x1522)

Questions

7votes
3answers

Errors using Pomelo MySQL EF provider with ASP.NET Core 2.0 Preview

I am using Pomelo 1.1.2 on ASP.NET Core 2.0 Preview, along with EF 2.0 Preview. With their demo code, I get the following exception every time I call "UseMySql": System.TypeLoadException occurred HResult=0x80131522 Message=Method 'Clone' in type 'Microsoft.EntityFrameworkCore.Internal.MySqlOptionsExtension' from assembly 'Pomelo.EntityFrameworkCore.MySql, Version=1.1.1.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. Source=<Cannot evaluate [...] read more
mysql
asp.net-core
entity-framework-core
asp.net-core-2.0
pomelo-entityframeworkcore-mysql
7votes
1answer

Dynamically Loading an ASP.NET Core Assembly

I am trying to dynamically load a .NET Core DLL containing an ASP.NET Core's Startup class. I then want to instantiate the Startup class and hand it over to the TestHost API, so I can start the site in memory. I've written the following code: var directoryPath = @"C:\Dlls"; var [...] read more
asp.net-core
asp.net-core-mvc
.net-core
typeloadexception
asp.net-core-testhost
4votes
1answer

.NET Instantiation Error

First of all, sorry for this extra descriptive question. I was implementing my own assembly rather calling anything from GAC! I started with a Class Library project in Visual C# 2010 Express edition. The file Class1.cs looked very simple as: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Sample [...] read more
c#
php
.net
visual-studio-2010
4votes
2answers

Failed to initialize the Common Language Runtime (CLR) v2.0.50727 with HRESULT 0x80131522

I am getting the error Msg 6512, Level 16, State 27, Line 6 Failed to initialize the Common Language Runtime (CLR) v2.0.50727 with HRESULT 0x80131522. You need to restart SQL Server to use CLR integration features. i am using SQL Server 2008 R2 Edition with windows 7. This error occur [...] read more
sql
3votes
1answer

FFMpegConverter instance is not created from NReco.VideoConverter.dll version 1.1.2

I was trying to use NReco.VideoConverter.dll assembly in my .NET CORE 2.0 but FFMpegConverter instance is not created. I am getting below exception. Can you look into this and guide me how can I make an instance of FFMpegConverter using NReco.VideoConverter.dll and its version is 1.1.2. > system.TypeLoadException occurred HResult=0x80131522 [...] read more
c#
.net
.net-assembly
3votes
2answers

System.TypeLoadException referencing .NET 1.0 assemblies after .NET 4.0 migration

There's a project which was migrated from .NET 3.5 to .NET 4.0. The project has some references to .NET 1.0 assemblies, which are wrappers around COM objects. These .NET 1.0 assemblies and COM objects are product of an external company. The project compiles, but during runtime the first point when [...] read more
.net
com
migration
arcgis
2votes
1answer

Getting exception while creating Lucene indexer using DotNetRDf.Query.FullText

Hi I am trying to use DotNetRDf.Query.FullText in .Net core 3.1 to create Lucene indexer but getting below run time exception. Can you please help to resolve this issue? > System.TypeLoadException HResult=0x80131522 Message=Could not load type > 'MaxFieldLength' from assembly 'Lucene.Net, Version=4.0.0.0, Culture=neutral, > PublicKeyToken=85089178b9ac3181'. Sample Code: var indexer = [...] read more
.net-core
jena
lucene.net
fuseki
dotnetrdf
2votes
2answers

Serilog implementaiton breaking other configuration

Implementing serilog into our project. We already have AspNetCoreRateLimit implemented to thorttle calls to the API. The project is a .Net Core project but build targeting Net461 due to some dependencies. Prior to serilog the api was fine. Now having installed serilog we are getting an error. The error bubbles [...] read more
c#
.net
.net-core
asp.net-core-webapi
serilog
2votes
2answers

.Net Core Console App Hostting Signalr Hub Causes GetStreamItemType does not have implementation exception

I'm trying to host a Signalr hub in my .NET Core 3.0 console application. What I coded is as follows. When I run I got "GetStreamItemType does not have implementation" exception. static void Main(string[] args) { BuildWebHost(args).Run(); } public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args).UseStartup<Startup>().Build(); public class Startup { public [...] read more
.net-core
signalr
2votes
1answer

C++/CLI static object with type deduction causes unhandled runtime exception

Setup While trying to create a static object at the translation unit scope in a C++/CLI wrapper for a native C++ lib, I ran into an issue with using the auto keyword. The C++/CLI wrapper is purely functional so I was in need of using a ConcurrentDictionary to hold some [...] read more
.net
c++-cli
2votes
0answers

Lazy loading crashes with "get_Info" not implemented under EF Core 3

I followed the docs telling me that since version 2.1, I can do the following. services.AddDbContext<Context>(c => c .UseLazyLoadingProxies() .UseSqlServer(...)); It doesn't work throwing the exception below. Commenting out the UseLazyLoadingProxies part makes it function properly, it's the laziness that's to blame). > System.TypeLoadException HResult=0x80131522 Message=Method 'get_Info' in type > [...] read more
c#
entity-framework
.net-core
lazy-loading
ef-core-3.0
2votes
1answer

Could not load type 'System.Runtime.Remoting.Messaging.CallContext' when calling into Mongo's C# Driver on .NET Core

I'm upgrading my web application from the .NET Framework version of ASP.NET MVC to ASP.NET Core. I've worked through all of the C# and Razor build errors, and now I'm trying to run the application for the first time. When I make any calls into MongoDB's C# driver: public static [...] read more
c#
mongodb
asp.net-core
.net-core
mongodb-.net-driver
2votes
2answers

Use SqlGeography at ServiceStack.OrmLite in .Net Core

I try to add SqlGeography to my model and when I call create table I got weird error. First I add this package: Microsoft.SqlServer.Types Then I create my model like example at below: public class Locations { public int Id { get; set; } public string Name { get; set; [...] read more
c#
.net-core
servicestack
ormlite-servicestack
2votes
2answers

Is there any class count limit in MFC project compiled with /CLR

With the risk to fall into too specific question... Given a C++ MFC (mixed, not shaked) project compiled with /CLR, I have 200 classes already defined. When I add a new empty class to this project, an error raises when I compile and execute in debug mode. > An unhandled [...] read more
debugging
visual-studio-2013
mfc
c++-cli
clr
2votes
2answers

Calling COMVisible VB.Net dll from C++ using CoCreateInstance

In some measure of progress since my last question I have got the following project to compile. It is based on https://stackoverflow.com/a/10949784/846550 However at runtime the call to CoCreateInstance fails. The HRESULT is 0x80131522 - google for this and most hits seem to relate to SQL server which I am [...] read more
c++
vb.net
dll
com
2votes
1answer

Need to call a .Net Class library dll from a Classic ASP Page

I need to call a .Net Class Library from a vbscript application I have written a C# class library and created a COM DLL component and a type library file I have successfully registered the dll and tlb on my local computer using C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe "C:\user\Visual Studio 2008\Projects\[Sample]\[Sample]\bin\Debug\[Sample].dll" /tlb "C:\user\Visual Studio [...] read more
.net
vbscript
asp-classic
com-interop
class-library
1vote
1answer

Receiving error: Method 'FindIdentityResourcesByScopeNameAsync' does not have an implementation

I'm attempting to execute the following: var builder = services.AddIdentityServer( options => { options.IssuerUri = "https://boo.com"; }) .AddExtensionGrantValidator<LPDelegationGrantValidator>() .AddProfileService<ONBProfileService>() .AddOperationalStore(options => { options.ConfigureDbContext = b => { b.UseSqlServer(connectionString, db => db.MigrationsAssembly(migrationsAssembly)); }; }) .AddConfigurationStore(options => { options.ConfigureDbContext = b => { b.UseSqlServer(connectionString, db => db.MigrationsAssembly(migrationsAssembly)); }; }); This used to [...] read more
identityserver4
1vote
2answers

System.TypeLoadException Could not load type 'Microsoft.EntityFrameworkCore.Query.RelationalQueryContextFactory'

I have written basic simple query which was working before when I was using .net core 2.2 (I have used linq2db.EntityFrameworkCore) projectContext.DocumentAnnotation.ToLinqToDBTable().InsertWithIdentity(() => new DocumentAnnotation { Name = name, ParentId = parentId })) after upgrade It to .net core 3.0 I am getting below error. System.TypeLoadException HResult=0x80131522 Message=Could not load [...] read more
c#
entity-framework
asp.net-core
entity-framework-core
linq2db
1vote
1answer

In Debug Mode I am getting a "Could not load file or assembly" error when I try to run my Visual C++ CLI application in debug. Release works

We're working on a programme for an internship but lacking an expert in C++/CLI. The programme compiles and works in release. The programme compiles in debug but on launch crashes with this error: > Additional information: Could not load file or assembly ', Version=0.0.0.0, > Culture=neutral, PublicKeyToken=null' or one of [...] read more
.net
dll
c++-cli
1vote
1answer

Table valued function only returns CLR error

I have read-only access to a database that was set up for a third-party, closed-source app. Once group of (hopefully) useful table functions only returns the error: > Failed to initialize the Common Language Runtime (CLR) v2.0.50727 with HRESULT > 0x80131522. You need to restart SQL server to use CLR [...] read more
sql-server
sql-server-2005
user-defined-functions
0votes
1answer

Owin/System.Web.Http.SelfHost - Won't Start after migration to .NET Core

I migrated the project from .NET Framework to .NET Core, by creating a new project, importing the code and installing dependencies. Everything has gone well, except for the API component.Previously I used System.Web.Http.Selfhost, however now when I try to run the program I get the following exception: > System.TypeLoadException HResult=0x80131522 [...] read more
c#
.net-core
owin
self-host-webapi
0votes
1answer

ASP.Net Core, Entity Framework and MySQL Gives a Create exception? Any ideas why?

I have a working ASP.Net Core application with SQL Server and Entity Framework. I use DI to inject the database context. The solution has a web project and a data project. I am looking to move to MySql and have made some small changes to the code. Running the application [...] read more
c#
mysql
asp.net-core
entity-framework-core
0votes
1answer

Azure Service Fabric and Azure Key Vault Secret Error

I am getting the following when trying to implement Azure Key Vault Secret from a stateless service fabric works just fine from a console app. System.TypeLoadException HResult=0x80131522 Message=Inheritance security rules violated by type: 'System.Net.Http.WebRequestHandler'. Derived types must either match the security accessibility of the base type or be less accessible. [...] read more
azure-service-fabric
azure-keyvault
0votes
1answer

Use string of class name to new a class

I want to use a class name sting to new a class NameSpace is Mcs.ControlMaster Class Name is HostTransportCommand after check some posts here. I use Activator var msg = Activator.CreateInstance(Type.GetType("Mcs.ControlMaster.HostTransportCommand", true)); got exception System.TypeLoadException HResult=0x80131522 Message=Could not load type 'Mcs.ControlMaster.HostTransportCommand' from assembly 'Mcs.ControlMaster.UT, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Source=<Cannot evaluate the [...] read more
c#
reflection
0votes
0answers

I am getting GetEntityStaticMedata type load exception

I connected the application to the database I am using. With the old version of MVC5 application can access this database and repository. I made ASP.NET CORE 3.1 to talk to the repository and I am getting this error as below. Error > System.TypeLoadException HResult=0x80131522 Message=Method 'GetEntityStaticMetaData' in type 'CDS.DataAccessLayer.EntityClasses.AddressEntity' [...] read more
llblgenpro
llblgen
0votes
1answer

Error on startup after upgrading from .Net Core 3.0 preview to .Net Core 3.0 release

I am using the same code in .Net Core 3.0 preview without any problem. After updating to Core 3.0 final release, I got this error: > System.TypeLoadException HResult=0x80131522 Message=Method 'get_Info' in type > 'Microsoft.EntityFrameworkCore.SqlServer.Infrastructure.Internal.SqlServerOptionsExtension' > from assembly 'Microsoft.EntityFrameworkCore.SqlServer, Version=3.0.0.0, > Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an > implementation. The line [...] read more
c#
.net
model-view-controller
.net-core
0votes
1answer

Xamarin.UWP app doesn't start because 'Microsoft.Graphics.Canvas.UI.Xaml.CanvasImageSource' could not be loaded

I'm developing an Android/iOS/UWP Xamarin.Forms app. The last weeks I worked mainly on the Android/iOS apps. Now, I want to start my app again in UWP and get the error: System.TypeLoadException HResult=0x80131522 Message=Could not find Windows Runtime type 'Microsoft.Graphics.Canvas.UI.Xaml.CanvasImageSource'. Source=Xamarin.Forms.Platform.UAP StackTrace: at Xamarin.Forms.Platform.UWP.ImageRenderer.GetDesiredSize(Double widthConstraint, Double heightConstraint) at Xamarin.Forms.Platform.UWP.Platform.GetNativeSize(VisualElement element, Double [...] read more
xamarin
xamarin.forms
uwp
xamarin.uwp
0votes
1answer

Referencing ASP.NET framework 4.6.2 in ASP.NET Core, Which use System.Web.HttpContext.Current

I have a class in ASP.Net framework 4.6 SessionHelper Code of class is as follow using System; using System.Web; using MyPortal.Common.Entity; using MyPortal.Common.Helper; namespace MyPortal.BusinessLayer.Helper { public static class SessionHelper { public static User GetLoggedInUser { get { return (User) GetFromSession(User.SESSION_LOGGEDIN_USER); } } public static User GetLoggedInExternalUser { get { [...] read more
c#
asp.net
.net-core
0votes
1answer

FieldsOffset in structs in x64 C# application

We want to call a C++ function in a x64 application: https://www.inventcom.net/fanuc-focas-library/misc/cnc_diagnoss We need to pass a ODBDGN struct to the function. This struct has an union in it so in c# we cannot defined union we need to do this: [StructLayout(LayoutKind.Explicit, Pack=4)] public class ODBDGN { [FieldOffset(0)] public short [...] read more
c#
struct
64-bit
dllimport
0votes
1answer

Host Service to receive notifications from Web Service in UWP

I'll explain my use case that I'm trying to solve which will give you clear picture of what I need? We have a web service hosted on a device and I'm able to consume the API's exposed by the service through the wsdl files that they share. But for some [...] read more
wcf
uwp
servicehost
0votes
0answers

Error while hosting .NET 1.1 application on IIS7

I am hosting a .NET 1.1 application on IIS7 while browsing my application i am getting an error in application event logs. > Failed to execute request because the App-Domain could not be created. Error: > 0x80131522 Event ID : 1088 Source : ASP.NET 2.0.50727.0 I'm running windows server 2008 [...] read more
asp.net
.net
iis
iis-7
0votes
0answers

Can't create projects

I am facing an issue with Visual Studio 2015. When I click on new project/add new file, I get an error message. I get this error even for clicking few menu items. Error when click on new project [https://i.stack.imgur.com/Ht6nG.png] > Set property 'System.Windows.ResourceDictionary.DeferrableContent' threw an > exception. I even get [...] read more
visual-studio
visual-studio-2015
0votes
1answer

Turning on CLR support is causing System.IO.FileLoadException

I have a big legacy C++/MFC application which is being extended via a C# class library. There's a C++/CLI wrapper for this so the legacy program doesn't need CLR support turned on, but with that it is impossible to debug through the managed code while running the native project. Turning [...] read more
c#
c++
.net
visual-studio-2012
0votes
1answer

Microsoft.VisualStudio.Services.WebApi Error

I have an ASP.net MVC Web application running on .Net Framework v4.6.1 which is referring library project, which, in turn is referring to the Nuget package 'Microsoft.TeamFoundationServer.ExtendedClient' v14.89.0. This package depends on the Nuget package 'Microsoft.VisualStudio.Services.Client' v14.89.0, among others. Today, I upgraded the 'TeamFoundationServer.ExtendedClient' to v15.112.1 (latest stable) which in [...] read more
c#
nuget
0votes
0answers

.NET Core MySql TypeLoadException - Method Clone

I'm trying to make a .NET Core 2.0 console application work with a MySQL database using Entity Framework. I've tried both the Oracle ( https://www.nuget.org/packages/MySql.Data.EntityFrameworkCore/ ) and Pomelo ( https://www.nuget.org/packages/Pomelo.EntityFrameworkCore.MySql ) connectors and both of them throw a TypeLoadException: Oracle Exception: System.TypeLoadException occurred HResult=0x80131522 Message=Method 'Clone' in type 'MySQL.Data.EntityFrameworkCore.Infraestructure.Internal.MySQLOptionsExtension' from [...] read more
mysql
oracle
entity-framework
.net-core
0votes
0answers

Connecting a COM Event Source via Interop

I am trying to expose a COM Event Source from C#. I have the following event interface that is imported from a TLB: [Guid("AAAABBBB-CCCC-DDDD-EEEEFFFFAAAA")] [InterfaceType(2)] [TypeLibType(4096)] public interface _IFooEvents { [DispId(20)] void FooEvent(int Value); // Remainder of elements omitted for brevity } I'm attempting to implement this event interface as [...] read more
c#
com-interop
0votes
0answers

TypeLoadException using WinRT Brokered Component

I am building a Windows Store App using a brokered component. The brokered component is meant to enable interaction with an RFID reader on the device. When I try to initialize an instance of the class exposed by the brokered component, I received a System.TypeLoadException with the message Could not [...] read more
c#
windows-runtime
windows-store-apps
winrt-component
0votes
0answers

System.IO.FileLoadException occurred in unknown module in MFC project using a WPF user control

I have a project in MFC that uses a WPF user control targeting .NET 4.0. When I run the program I get the following exception > An unhandled exception of type 'System.IO.FileLoadException' occurred in > Unknown Module. > > Additional information: Could not load file or assembly 'MyProject' , > [...] read more
c#
wpf
visual-c++
mfc
interop
0votes
1answer

How to debug a TypeLoadException during ngen

SITUATION I'm using ngen to create native images of my assemblies during the installation. This worked fine until recently and I've no idea what broke it. Sadly the ngen output isn't very helpful. It just says that it couldn't find or load a type, but doesn't say which type. What's [...] read more
c#
.net
visual-studio-2010
msbuild
ngen
0votes
1answer

Why is Assembly.GetCustomAttributes suddenly throwing TypeLoadException on build machine with Silverlight 4?

A short while back i had to display the current version of our Silverlight app. After some googling the following code gave me the desired result: var fileVersionAttributes = typeof(MyClass).Assembly. GetCustomAttributes(typeof(AssemblyFileVersionAttribute), false) as AssemblyFileVersionAttribute[]; var version = fileVersionAttributes[0].Version; This worked a treat in our .NET 3.5 Silverlight 3 environment. However, [...] read more
c#
continuous-integration
silverlight-4.0
typeloadexception
assemblyversionattribute
-1votes
1answer

What using statements are needed to use Deedle in C#? "Could not load type 'Deedle.Frame'" exception

2nd Edit: I have found a MS log viewer, which does not enlighten me. Here is what it shows: *** Assembly Binder Log Entry (10/15/2020 @ 4:09:38 PM) *** The operation failed. Bind result: hr = 0x80070002. The system cannot find the file specified. Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll Running [...] read more
c#
exception
deedle
-1votes
1answer

.netCore web application throws exception at UseWebpackDevMiddleware in startup.cs after including nuget

Here are some details of my app and the error I am getting: .NetCore Version : 2.0 Exception File name : Startup.cs line number : 41 UseWebpackDevMiddleware() Package Reference: <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.1.1" /> <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6" /> <PackageReference Include="Microsoft.PowerBI.Api" Version="2.0.12" /> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.3" /> Stack trace: System.TypeLoadException HResult=0x80131522 Message=Could [...] read more
asp.net-core
.net-core
asp.net-core-mvc
asp.net-core-2.0

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