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
18
votes
3 answers

Ignore missing dependencies during ReflectionOnlyLoad

I am working on a simple class browser dialog that allows users to open an assembly and choose a static method from within. However, there are some situations where the assembly's dependencies are missing. Since I only need the method name and not…
Nathan Baulch
  • 20,233
  • 5
  • 52
  • 56
17
votes
3 answers

Is it possible to replace a reference to a strongly-named assembly with a "weak" reference?

I'm writing a .NET tool that requires the SQL Server SMO library. I don't care if it's the version from Server 2005 (9.0), 2008 (10.0) or 2008 R2 (probably 10.5, didn't check). The SMO library is installed together SQL Server, so I can safely assume…
Heinzi
  • 167,459
  • 57
  • 363
  • 519
17
votes
2 answers

Why is the build failing in Visual Studio because it cannot resolve namespaces from referenced assemblies?

I have 3 class library projects. Lets call them A, B & C. I have added project reference of A & B into the project C. A & B are building without any error or warning. Code(Class file) from the project C uses public classes from A & B. When I add…
Learner
  • 4,661
  • 9
  • 56
  • 102
17
votes
3 answers

Load assembly from network location

I am trying to load assembly by : Assembly component = Assembly.LoadFrom(componentPath); where componentPath is a full path of network location and get the the following error: An attempt was made to load an assembly from a network location which…
Sergey Kucher
  • 4,140
  • 5
  • 29
  • 47
17
votes
2 answers

C# - Referencing a type in a dynamically generated assembly

I'm trying to figure out if it's possible when you are dynamically generating assemblies, to reference a type in a previously dynamically generated assembly. For example: using System; using System.CodeDom.Compiler; using System.Reflection; using…
Ashley
  • 471
  • 7
  • 15
17
votes
1 answer

How can I get all the inherited classes of a base class?

class Foo { } class Foo1 : Foo { } class Foo2 : Foo { } How would I be able to get all the classes that use Foo as a base class? The inherited classes aren't necessary in the same assembly.
Carlsberg
  • 659
  • 2
  • 7
  • 8
17
votes
2 answers

Maven-assembly-plugin: custom jar filenames

I use the assembly plugin to create several jars with some classes in it. I need custom names for the resulting jars: app_business.jar app_gui.jar core.jar etc. Currently I have to following configuration:
Synox
  • 1,148
  • 2
  • 17
  • 38
16
votes
1 answer

How do I create a .NET assembly in IronPython and call it from C#?

I want to create an assembly using IronPython can call it from C#. Here are two things I am not asking. I'm not asking how to call C# from IronPython. The easiest documentation to find describes how to call C# from inside IronPython. (For example,…
John D. Cook
  • 29,517
  • 10
  • 67
  • 94
16
votes
7 answers

How do you install files in the assembly in Windows Server 2008?

Typically what I used to do is drag and drop the files onto the GAC folder. This works in Windows 2000 & 2003, however when I try to do this in Windows Server 2008 I get 'Access is denied'. The user that is doing this is a local administrator. The…
Bravax
  • 10,453
  • 7
  • 40
  • 68
16
votes
1 answer

Why does my Xamarin PCL throw a runtime exception when Building release for Universal App?

I have a xamarin PCL that builds fine in x86 Debug mode. When I switch it to Release Mode (x86 or x64) or x64 Debug, I am getting runtime exceptions. It probably relates to…
Seth Kitchen
  • 1,526
  • 19
  • 53
16
votes
2 answers

Maven: How to create assembly with snapshot artifacts without timestamps file name?

I've a repository containing snapshot artifacts with timestamps. I want to create an assembly, that contains the dependencies. This works fine. But the artifact names contains the timestamp. So i wonder how to remove the timestamp from filename for…
marabol
  • 1,247
  • 2
  • 15
  • 22
16
votes
4 answers

Binding redirect problem in .net

I have a class library called "MyAssembly" that is internally referencing a.dll, b.dll of version 3.1.1.0; I have build the project which outputed MyAssembly.dll. On a different system (box) I have created a web application project and referenced…
Suresh
  • 161
  • 1
  • 1
  • 3
16
votes
4 answers

C#: Custom assembly directory

Say we have an application which consists of one executable and 5 libraries. Regularly all of these will be contained in one directory and the libraries will be loaded from there. Is it possible to do so that I can have for example some of the…
Svish
  • 152,914
  • 173
  • 462
  • 620
16
votes
3 answers

.NET Cross-Assembly Performance Hit

I am reading Bill Wagner's book Effective C#. In Item 32 he is advocating for developers to create smaller, more cohesive assemblies that can be reused more readily. However, in that same item he says: ... Extra Security checks also are done…
dewald
  • 5,133
  • 7
  • 38
  • 42
16
votes
6 answers

Modifying Existing .NET Assemblies

Is there a way to modify existing .NET assemblies without resorting to 3rd party tools? I know that PostSharp makes this possible but I find it incredibly wasteful that the developler of PostSharp basically had to rewrite the functionality of the…
Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214