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.

2340 questions
886
votes
7 answers

What are differences between AssemblyVersion, AssemblyFileVersion and AssemblyInformationalVersion?

There are three assembly version attributes. What are differences? Is it ok if I use AssemblyVersion and ignore the rest? MSDN says: AssemblyVersion: Specifies the version of the assembly being attributed. AssemblyFileVersion: Instructs a…
Jakub Šturc
  • 32,938
  • 24
  • 85
  • 107
854
votes
13 answers

How to enable assembly bind failure logging (Fusion) in .NET

How do I enable assembly bind failure logging (Fusion) in .NET?
user32736
  • 9,511
  • 3
  • 16
  • 6
778
votes
5 answers

How can I get the assembly file version

In AssemblyInfo there are two assembly versions: AssemblyVersion: Specify the version of the assembly being attributed. AssemblyFileVersion: Instructs a compiler to use a specific version number for the Win32 file version resource. The Win32 file…
Enyra
  • 16,432
  • 12
  • 33
  • 43
342
votes
16 answers

How can I determine if a .NET assembly was built for x86 or x64?

I've got an arbitrary list of .NET assemblies. I need to programmatically check if each DLL was built for x86 (as opposed to x64 or Any CPU). Is this possible?
Judah Gabriel Himango
  • 55,559
  • 37
  • 152
  • 206
255
votes
16 answers

How to fix "Referenced assembly does not have a strong name" error

I've added a weakly named assembly to my Visual Studio 2005 project (which is strongly named). I'm now getting the error: "Referenced assembly 'xxxxxxxx' does not have a strong name" Do I need to sign this third-party assembly?
ng5000
  • 11,400
  • 10
  • 49
  • 63
226
votes
14 answers

Why should you remove unnecessary C# using directives?

For example, I rarely need: using System.Text; but it's always there by default. I assume the application will use more memory if your code contains unnecessary using directives. But is there anything else I should be aware of? Also, does it make…
steffenj
  • 7,729
  • 10
  • 33
  • 41
181
votes
13 answers

Can I load a .NET assembly at runtime and instantiate a type knowing only the name?

Is it possible to instantiate an object at runtime if I only have the DLL name and the class name, without adding a reference to the assembly in the project? The class implements a interface, so once I instantiate the class, I will then cast it to…
MegaByte
  • 6,445
  • 10
  • 34
  • 33
165
votes
8 answers

What are the best practices for using Assembly Attributes?

I have a solution with multiple project. I am trying to optimize AssemblyInfo.cs files by linking one solution wide assembly info file. What are the best practices for doing this? Which attributes should be in solution wide file and which are…
Jakub Šturc
  • 32,938
  • 24
  • 85
  • 107
157
votes
7 answers

C#: why sign an assembly?

In some C# code I have taken over (in Visual Studio 2005), I have noticed that the assemblies are all signed with the same .snk file. Why would the previous author have signed the assemblies in this way? Is signing assemblies necessary and…
Craig Johnston
  • 4,773
  • 8
  • 25
  • 30
138
votes
13 answers

How can I view MSIL / CIL generated by C# compiler? Why is it called assembly?

I'm new to .NET C# programming. I'm following few books. It is said that instead of compiling C# code directly to machine code, it is converted into an intermediate language (called MSIL aka CIL). But when I compile, I get an exe/dll file. Is this…
walter
136
votes
15 answers

How to extract an assembly from the GAC?

There is a package I have to deal with which installs assemblies straight into the GAC (e.g. somewhere deep in %windows%/assembly). How do I exorcise the actual assembly (the DLL) from the GAC into the normal file system? Thanks.
AngryHacker
  • 54,471
  • 90
  • 289
  • 523
134
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
  • 42,877
  • 83
  • 270
  • 415
134
votes
8 answers

How to add folder to assembly search path at runtime in .NET?

My DLLs are loaded by a third-party application, which we can not customize. My assemblies have to be located in their own folder. I can not put them into GAC (my application has a requirement to be deployed using XCOPY). When the root DLL tries to…
isobretatel
  • 3,318
  • 6
  • 27
  • 41
124
votes
11 answers

Dynamically replace the contents of a C# method?

What I want to do is change how a C# method executes when it is called, so that I can write something like this: [Distributed] public DTask Solve(int n, DEvent callback) { for (int m = 2; m < n - 1; m += 1) if (m % n == 0) …
June Rhodes
  • 2,369
  • 3
  • 19
  • 29
122
votes
2 answers

How do you loop through currently loaded assemblies?

I've got a "diagnostics" page in my ASP.NET application which does things like verify the database connection(s), display the current appSettings and ConnectionStrings, etc. A section of this page displays the Assembly versions of important types…
Jess Chadwick
  • 2,295
  • 2
  • 21
  • 24
1
2 3
99 100