Questions tagged [assemblies]

Assemblies are collections of compiled .Net types and resources grouped into a logical and physical unit (in the form of a .dll file or .exe file).

Assemblies are collections of compiled .Net types and resources grouped into a logical and physical unit (in the form of a .dll file or a .exe file - which has an entry point).

If a .exe is a .NET assembly then it also contains a CLR header as a data block inside the PE header.

2372 questions
36
votes
7 answers

Strange Error - CS0012: The type x is defined in an assembly that is not referenced

The type 'x' is defined in an assembly that is not referenced. You must add a reference to assembly 'abc123'. I have a .NET 2.0 web application that references my assembly 'abc123'. The assembly exists in the GAC and I've verified that it is the…
Mike T
  • 415
  • 2
  • 5
  • 9
35
votes
4 answers

Visual Studio 2010: Reference Assemblies Targeting Higher Framework Version

Visual Studio 2008 did let you reference an assembly A from an Assembly B when A was targeting .NET 3.5 and B was targeting .NET 2.0. Visual Studio 2010 doesn't allow for this any more. The full issue is described on MSDN: You can create…
Johannes Rudolph
  • 35,298
  • 14
  • 114
  • 172
35
votes
1 answer

Difference between AppDomain.GetAssemblies and BuildManager.GetReferencedAssemblies

Just wanted to know if there is any difference between the two, in the context of a fully trust asp.net mvc 2 application.
Herman
  • 3,004
  • 5
  • 37
  • 49
35
votes
4 answers

What are the `exact` differences between .NET dll and a normal dll?

I want to know what are the exact differences between .NET dll and a normal dll. First question, what is "normal DLL" called? I'm using the word 'normal'. But it doesnt seem right? Because both follow the PE format. Yeah, I agree that .NET DLL has…
Buttler
  • 391
  • 1
  • 4
  • 5
35
votes
5 answers

Referencing different versions of the same assembly

If A references assembly B 1.1 and C, and C references B 1.2, how do you avoid assembly conflicts? I naively assumed C's references would be encapsulated away and would not cause any problems, but it appears all the dll's are copied to the bin,…
Dan
  • 29,100
  • 43
  • 148
  • 207
34
votes
6 answers

Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0, Elmah.MVC issue

Locally - my MVC 4, asp.net, c# app runs fine on IIS 8 / Windows 8. When deployed to Windows Server 2008, I get this error: Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of…
niico
  • 11,206
  • 23
  • 78
  • 161
33
votes
3 answers

C# Namespaces and Assemblies Best Practice

C#: are there any guidelines, best practices when it comes to dividing a solution up into namespaces and assemblies? Should namespaces normally be nested, with the most low level and fundamental classes in the top level namespace? Should there…
Rich Oliver
  • 6,001
  • 4
  • 34
  • 57
33
votes
2 answers

How to reference a namespace from a specific assembly?

So here is my problem. My (test) project references both Castle Windsor and Rhino Mocks. I am creating a class which implements Castle.Core.Interceptor.IInterceptor from the Castle.Core.dll assembly In building Rhino Mocks, Ayende used…
George Mauer
  • 117,483
  • 131
  • 382
  • 612
32
votes
8 answers

How to determine whether a DLL is a managed assembly or native (prevent loading a native dll)?

Original title: How can I prevent loading a native dll from a .NET app? Background: My C# application includes a plugin framework and generic plugin loader. The plugin loader enumerates the application directory in order to identify plugin dlls…
Mr. Wilby
  • 329
  • 1
  • 3
  • 5
32
votes
2 answers

ASP.NET - AppDomain.CurrentDomain.GetAssemblies() - Assemblies missing after AppDomain restart

I have a Bootstrapper that looks through all Assemblies in an ASP.NET MVC application to find types that implement an IBootstrapperTask interface, and then registers them with an IOC Contrainer. The idea is that you can literaly place your…
Sunday Ironfoot
  • 12,840
  • 15
  • 75
  • 91
31
votes
6 answers

Updating the version number of all assemblies in a solution

I've got a rather large solution in Visual Studio. Is there a way to update the Major / Minor version numbers for all the assemblies in the solution in one go?
PaulB
  • 23,264
  • 14
  • 56
  • 75
31
votes
5 answers

How can i see the assembly version of a .NET assembly in Windows Vista and newer (WIndows 7, 2008)?

In windows 2003 and windows XP you could right click on an assembly (.dll) go to properties, click on the version tab and then you would see 3 different version numbers: Assembly version, file version and product version. If you take that same file…
Mark
  • 5,223
  • 11
  • 51
  • 81
31
votes
4 answers

How does visual studio determine what to copy to the output directory with multi-project solutions?

Let's say we have a solution with the following structure: Project.DAL - Data access layer, depends on a lower-level library, e.g. Oracle.DataAccess w/copy local = true Project.BLL - Business logic layer, references Project.DAL as project…
Josh Kodroff
  • 27,301
  • 27
  • 95
  • 148
31
votes
5 answers

Parsing assembly qualified name?

I would like to parse an assembly qualified name in .NET 3.5. In particular, the assembly itself is not available, it's just the name. I can think of many ways of doing it by hand but I guess I might be missing some feature to do that in the system…
Joannes Vermorel
  • 8,976
  • 12
  • 64
  • 104
30
votes
5 answers

Force load an assembly from the /bin and not the GAC?

I have two assemblies, created through conditional compilation (dev and real). The public surface of these assemblies is 100% identical: both are strongly named; both are signed with the same .snk and therefore have the same PublicKeyToken; both…
Michael Stum
  • 177,530
  • 117
  • 400
  • 535