Questions tagged [assembly-loading]

Questions regarding loading assemblies in.NET core, including questions on assemblies explicitly loaded via the API, as well as questions on runtime exceptions related to assembly load failure: "Could not load file or assembly..."

Questions regarding loading assemblies in.NET core, including questions on assemblies explicitly loaded via the API as well as questions on runtime exceptions related to assembly load failure: "Could not load file or assembly..."

104 questions
146
votes
7 answers

Difference between LoadFile and LoadFrom with .NET Assemblies?

I was looking at the msdn documentation and I am still a little confused on what exactly is the difference between using LoadFile and LoadFrom when loading an assembly. Can someone provide an example or an analogy to better describe it. The MSDN…
Xaisoft
  • 45,655
  • 87
  • 279
  • 432
24
votes
8 answers

Could not load file or assembly 'Microsoft.VisualStudio.TestPlatform.ObjectModel, Version=11.0.0.0'

I am using MSTest.TestAdapter and MSTest.TestFramework both version 1.2.0 for my MS tests unit tests. On my local machine (Visual Studio 2017) the tests run perfectly, but on our build server we get this message: Could not load file or assembly …
Ben Croughs
  • 2,566
  • 1
  • 20
  • 30
20
votes
7 answers

Could not load file or assembly 'Microsoft.Practices.Unity'

I am trying to upgrade Unity to version (2.1.505.2), but when I run the application I get the following FileLoadException Could not load file or assembly 'Microsoft.Practices.Unity, Version=2.0.414.0, Culture=neutral,…
bas
  • 13,550
  • 20
  • 69
  • 146
15
votes
1 answer

Loading an assembly targeted for .NET 4.5 on a .NET 4.0 app domain

Assuming the system has .NET 4.0 and .NET 4.5 installed. Is it possible to load and work with a .NET 4.5 assembly from an assembly written targeting .NET 4.0? Simply put, can I call Assembly.Load from .NET 4.0 code to load a .NET 4.5 targeting…
Madushan
  • 6,977
  • 31
  • 79
12
votes
1 answer

Activator.CreateInstance: Could not load type from assembly

I'm trying to create an instance of a class implemented in a plugin .dll in my project to do type discovery. I'm receiving this exception: Could not load type 'Action' from assembly 'SquidReports.DataCollector.Plugin.BES, Version=1.0.0.0, …
romatthe
  • 1,447
  • 3
  • 17
  • 33
11
votes
3 answers

Could not load file or assembly 'Magick.NET-x64' issue on mvc application

I am using the Magick.net library in an mvc3 web application and these are steps i did My project is targeting AnyCPU and my machine is 64bit Add reference of Magick.NET-x64.dll to the project. Installed Visual C++ Redistributable for Visual…
Sebastian
  • 4,625
  • 17
  • 76
  • 145
9
votes
3 answers

Tridion: Unable to load .Net dll while publishing

I am using a .Net dll Newtonsoft.Json in my C# TBB to process components and generate Json data. I have already added this dll in GAC[Global Assembly Cache], and it works as well. But sometimes it doesn't work and I get the following error while…
Sunil Nadar
  • 517
  • 1
  • 5
  • 15
9
votes
3 answers

Is using Assembly.Load a static reference or dynamic reference?

What are the implications and suggested scenarios to use either?
GilliVilla
  • 4,998
  • 11
  • 55
  • 96
9
votes
3 answers

Windows Service: System.Reflection.ReflectionTypeLoadException was thrown with the following error message: Unable to load one or more of the re

I am using a windows service, In which I am having a reference of an assembly which is copy local= false. But I am trying to load it at runtime, which is though working fine when I am running it from visual studio, But when I try to install it, cmd…
eLs
  • 213
  • 2
  • 3
  • 8
8
votes
3 answers

Assembly Load error from DocumentFormat.OpenXml

I get an error using the Microsoft ClosedXml and DocumentFormat.OpenXml NuGet utility packages. After I updated these NuGet packages, (from version 2.7.2 to version 2.8.1), I now get this exception: Exception System.IO.FileLoadException: Could not…
Charles Bretana
  • 143,358
  • 22
  • 150
  • 216
7
votes
2 answers

How to load an assembly from byte array into a non-default AppDomain without accessing the app directory?

I have an in-memory assembly MyAssembly (class library) that is used in my main assembly MyApp.exe: byte[] assemblyData = GetAssemblyDataFromSomewhere(); (For testing, the GetAssemblyDataFromSomewhere method can just do File.ReadAllBytes for an…
dymanoid
  • 14,771
  • 4
  • 36
  • 64
7
votes
2 answers

Load an assembly without locking file AND keep the right Binding Context

I've comp up against a formidable conundrum. Here's my situation: I'm building an application with a plugin framework. There's a base plugin class that all plugins must extend. Within the same same assembly I have a helper class that will serialize…
JonH
  • 821
  • 11
  • 19
7
votes
1 answer

COM interop assembly loading sequence

There is very strange assembly reference problem and loading problem I experience with my Outlook addin. Here are the detail (a long story :) ): I have an old Outlook addin, written and build using .Net 1.1. The addin is loaded using an unmanaged…
Sunny Milenov
  • 21,990
  • 6
  • 80
  • 106
6
votes
3 answers

TeamCity NUnit runner fails because of x86 - x64 - MSIL discrepancies

I have a solution with a bunch of projects, some of which also have test projects. These are all compiled for the Any CPU platform. In TeamCity, I have a build configuration for NUnit 2.6.4, on which I specify Platform: auto (MSIL) and Version:…
Tomas Aschan
  • 58,548
  • 56
  • 243
  • 402
6
votes
2 answers

WPF resource loading fails in LoadFrom loading context

I have a WPF assembly that i use in an interop scenario from native code using the LoadFrom loading context like this: AppDomain.CreateInstanceFrom("c:\mydlls\mywpfstuff.dll", "myclass") Note that mydlls is not the same folder as where the…
Bragosaurus
  • 116
  • 8
1
2 3 4 5 6 7