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
68
votes
1 answer

Load WPF styles or other Static Resources from an external file or assembly

I have a few WPF applications and I want all my styles to be in a shared assembly instead of declaring them in each application separately. I am looking for a way so I don't have to change all my Style="{StaticResource BlahBlah}" in the existing…
Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632
68
votes
1 answer

Why are three properties in DbParameterCollection abstract in reference assemblies but virtual otherwise?

I'm moving a project from project.json to the new-style csproj format, and it includes a class derived from DbParameterCollection. In my real project I'm using multi-targeting, but for the purposes of this question we only need to care about…
Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
68
votes
10 answers

Assembly version from command line?

Is there a Microsoft tool to get the assembly version of a DLL file from a command line? (I know that I can code my own tool.)
Patrice Pezillier
  • 4,476
  • 9
  • 40
  • 50
68
votes
3 answers

Using different versions of the same assembly in the same folder

I have the following situation Project A - Uses Castle Windsor v2.2 - Uses Project B via WindsorContainer Project B - Uses NHibernate - Uses Castle Windsor v2.1 In the bin folder of Project A I have the dll Castle.DynamicProxy2.dll v2.2 and…
Hemanshu Bhojak
  • 16,972
  • 16
  • 49
  • 64
66
votes
2 answers

Custom Assembly Attributes

I would like to know if I can define custom assembly attributes. Existing attributes are defined in the following way: [assembly: AssemblyTitle("MyApplication")] [assembly: AssemblyDescription("This application is a sample application.")] …
Charlie Salts
  • 13,109
  • 7
  • 49
  • 78
63
votes
7 answers

Should I have a separate assembly for interfaces?

We currently have quite a few classes in a project, and each of those classes implement an interface, mostly for DI reasons. Now, my personal feeling is that these interfaces should be put into a separate namespace within the same assembly (so we…
David_001
  • 5,703
  • 4
  • 29
  • 55
63
votes
2 answers

How to reference .NET assemblies using PowerShell

I am a C# .NET developer/architect and understand that it uses objects (.NET objects) and not just streams/text. I would like to be able to use PowerShell to call methods on my .NET (C# library) assembies. How do I reference an assembly in…
Russell
  • 17,481
  • 23
  • 81
  • 125
62
votes
5 answers

Single-assembly multi-language Windows Forms deployment (ILMerge and satellite assemblies / localization) - possible?

I have a simple Windows Forms (C#, .NET 2.0) application, built with Visual Studio 2008. I would like to support multiple UI languages, and using the "Localizable" property of the form, and culture-specific .resx files, the localization aspect works…
Tao
  • 13,457
  • 7
  • 65
  • 76
61
votes
3 answers

How can I list all registered assemblies in GAC?

How can I list all the assemblies that are in the GAC? Do I need a tool that makes it easy to view them?
pencilCake
  • 51,323
  • 85
  • 226
  • 363
61
votes
12 answers

Determine framework (CLR) version of assembly

From the command line (or by any means really), how can I determine which CLR version a .NET assembly requires? I need to determine if an assembly requires 2.0 or 4.0 CLR version.
Klaus Byskov Pedersen
  • 117,245
  • 29
  • 183
  • 222
59
votes
2 answers

VS2005: Assembly '' is incorrectly specified as a file.

I've added a reference to the log4net assembly dll to my project. When I build I get a warning saying: Warning Assembly 'Lib\log4net.dll' is incorrectly specified as a file. I look up the help for this error on MSDN, and it says: This warning…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
58
votes
2 answers

Is there a way to specify assembly references based on build configuration in Visual Studio?

I have a project that adds some extensibility to another application through their API. However, I want to be able to use the same project for multiple versions of their application, because most of the code is the same. However, each version of the…
snicker
  • 6,080
  • 6
  • 43
  • 49
57
votes
4 answers

GetEntryAssembly for web applications

Assembly.GetEntryAssembly() does not work for web applications. But... I really need something like that. I work with some deeply-nested code that is used in both web and non-web applications. My current solution is to browse the StackTrace to find…
Mose
  • 1,781
  • 3
  • 16
  • 35
57
votes
6 answers

mscorlib.dll & System.dll

Why did MS originally make the decision to maintain these two separate core libs? Maybe they had some scalability issue in mind, but nowadays I never see an application, of any type, that doesn't need both. Does anyone have any inside information on…
user39603
  • 2,235
  • 1
  • 16
  • 13
57
votes
7 answers

Find out dependencies of all DLLs?

I have a collection of DLLs(say 20). How do I find out all the DLLs on which one specific DLL (say DLL A) is depending upon?
Abhijeet
  • 13,562
  • 26
  • 94
  • 175