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
10
votes
4 answers

Is it possible to save a dynamic assembly to disk?

I recently bought Ayende's book Building DSLs in Boo (buy it, read it, it's awesome) but I'm coming up against an implementation problem and I want to see what the generated code looks like. I would normally use reflector to look at the code but in…
Restore the Data Dumps
  • 38,967
  • 12
  • 96
  • 122
10
votes
1 answer

Unload CodeDom-compiled assembly

I have some C# code (let's call it "script") I am compiling at runtime. It uses an interface in my main program that I use to access its functions. Once compiling is done I have CompilerResults.CompiledAssembly in which case I can…
Nelson Rothermel
  • 9,436
  • 8
  • 62
  • 81
10
votes
6 answers

How to get custom attributes from an assembly that is not (really) loaded

We all know that the assembly can be queried for attributes using the GetCustomAttributes method. I want to use this to identify an extension module for my application. However, to avoid loading every assembly I prefer a defensive approach: using…
Marc Wittke
  • 2,991
  • 2
  • 30
  • 45
10
votes
3 answers

How can I include unit tests in maven assembly?

Reason: Our project is using Ant as commandline interface. After making a new assembly with maven's assembly plugin, I want to make initial tests to see if all has been properly assembled. Therefore I need to include the unit tests in the final…
Roman
10
votes
2 answers

Modules, Assemblies, Headers in CLR

I've been reading CLR with C# 3.0 and I've been reflecting on Assemblies, Modules and Headers however things got complicated. This is what I understood but if would be great if someone can clarify things little bit more: Modules are result of…
Tarik
  • 79,711
  • 83
  • 236
  • 349
9
votes
2 answers

How can I add a reference in a Visual Studio website project type?

Normally when you add a new assembly you have to go into Visual Studio and add a reference (the .dll is stored in the /bin directory). Since this website compiles on the fly, is it possible for me to just add the .dll to the live website, and then…
Blankman
  • 259,732
  • 324
  • 769
  • 1,199
9
votes
1 answer

Is there a description of the IL disassembler icons available somewhere

I'm playing around with the MS IL disassembler, which lets you view the contents of a .Net assembly. The classes and Interfaces are shown in a tree view, nicely encoded with colors and icons. It's rather easy to guess the meaning of most icons,…
Thomas
  • 1,160
  • 3
  • 16
  • 34
9
votes
3 answers

Hiding types from being listed in Assembly.GetTypes in .net

Ive been looking everywhere for a possible solution to this but can't seem to find an answer. My issue is that I have a few classes that need to completely hidden from Assembly.getTypes, as I'm writing a plugin for an application, and it's picking…
Jeremy Tang
  • 153
  • 1
  • 5
9
votes
3 answers

CompilerParameters.ReferencedAssemblies -- Add reference to System.Web.UI.WebControls

I am compiling classes at run-time using the CodeDomProvider class. This works fine for classes only using the System namespace: using System; public class Test { public String HelloWorld() { return "Hello World!"; } } If I try…
cllpse
  • 21,396
  • 37
  • 131
  • 170
9
votes
1 answer

Binding redirect fails - different publicKeyToken

I have an application that references this assembly in development environments: name="Microsoft.Data.SqlXml" culture="neutral" publicKeyToken="89845dcd8080cc91" version="9.0.242.0" However, live server contains old version of this…
dragonfly
  • 17,407
  • 30
  • 110
  • 219
9
votes
2 answers

Debug dynamically loaded assembly

I am debugging an assembly which I loaded dynamically with Assembly.Load(Byte[]), but I am facing some problems. First of all, I can't move the yellow arrow in Visual Studio 2010 to step into other lines of code, and also I am getiing exceptions…
user410989
9
votes
2 answers

When probing for assemblies why does the searched for publicKeyToken differ when running as admin vs as a normal user?

I'm following instructions from a 2006 Microsoft .Net course workbook, going through one of the exercises. (Specifically this course is MS2349B and I'm doing Module 4 Exercise 2.). These exercises seem to built for the pre Vista days when everyone…
Doug T.
  • 64,223
  • 27
  • 138
  • 202
9
votes
3 answers

How can you make a c# project ignore the version number of an assembly?

I am working on a project that references dlls from another product. The product has a release each year and the assemblies version changes for each one, although the methods stay the same. When I run a build of my project for 2010 when I try and…
Mark O'Grady
  • 1,144
  • 3
  • 14
  • 22
9
votes
1 answer

How do i find declared methods only, when doing a runtime assembly load?

I'm doing a runtime assembly load, but i don't know the names of any classes or methods. I wan't to list all classes in my assembly with their declared methods, not those inherited from System.Object. This is the code: string str = ""; Assembly…
Bildsoe
  • 1,310
  • 6
  • 31
  • 44
9
votes
5 answers

Cannot use external references with C# Console Application

I have tried all the suggestions below but still no joy. I'm now trying a console application, and let me explain exactly what I'm doing. I create a new console project in VS 2010 I add a number of references (dll's) some that aren't mine such as…
JGilmartin
  • 8,683
  • 14
  • 66
  • 85