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

Loading multiple versions of the same assembly

I'm working with a third-party assembly and unfortunately I now need to load their latest and a previous version into my project so at runtime I can decide which one to load. I only ever need one, not both. With this in mind, I am also dependent…
GT.
  • 545
  • 1
  • 8
  • 18
19
votes
3 answers

Can't find Microsoft.SqlServer.ConnectionInfo.dll assembly file?

I'm trying to dynamically get a databases Table structure using only C# code as follows: using Microsoft.SqlServer.Management.Common; using Microsoft.SqlServer.Management.Smo; public class LoadStuff { ... public void LoadDatabase(string…
delete
19
votes
3 answers

Difference between Assembly.CreateInstance and Activator.CreateInstance?

What is the difference between these calls?
TheNoob
19
votes
2 answers

.NET assembly loading priorities

I have a solution with 3 projects (GUI, BL and DAL). The DAL assembly is signed and deployed in the GAC. When I build the solution the DAL is compiled and the assembly placed in the bin folder of the main project. But when I run the application, it…
Dante
  • 3,833
  • 4
  • 38
  • 55
18
votes
4 answers

How to mark a .net assembly as safe?

How do i mark as assembly as "safe"? Alternatively, how do i have Visual Studio tell me when something in my assembly is not "safe"? Sometimes you cannot use an assembly unless it is "safe" (e.g. from SQL Server). i would like my assembly to be…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
18
votes
8 answers

Could not load file or assembly 'someProject' or one of its dependencies. Access is denied

I am stuck with one asp.net error. My application work fine on development and test environemnt. But on production it give me following error: Could not load file or assembly 'someProject' or one of its dependencies. Access is denied.
Syed Tayyab Ali
  • 3,643
  • 7
  • 31
  • 36
18
votes
3 answers

.csproj's platform specific ItemGroup works for assembly references but not content includes?

Since we have three assemblies that come in explicit x86 and x64 versions, I've edited the corresponding .csproj file(s) to use, for example, a block like this:
Jörg Battermann
  • 4,044
  • 5
  • 42
  • 79
18
votes
5 answers

how to delete the pluginassembly after AppDomain.Unload(domain)

i have a weird problem. i would like to delete an assembly(plugin.dll on harddisk) which is already loaded, but the assembly is locked by the operating system (vista), even if i have unloaded it. f.e. AppDomainSetup setup = new…
Ase
  • 1,105
  • 1
  • 9
  • 10
18
votes
4 answers

Why would System.Type.GetType("Xyz") return null if typeof(Xyz) exists?

I have come across a strange behaviour in my (huge) .NET 4 project. At some point in the code, I am referring to a fully qualified type, say: System.Type type = typeof (Foo.Bar.Xyz); later on, I do this: System.Type type = System.Type.GetType…
Pierre Arnaud
  • 10,212
  • 11
  • 77
  • 108
18
votes
2 answers

Is it necessary to change the assemblyIdentity's version attribute in a manifest file?

In the following manifest, is it necessary to change the version attribute of the assemblyIdentity element if the assembly version is specified in the project (or, in my case, set as part of a MSBuild task)? According to this Microsoft Connect page,…
Mark Carpenter
  • 17,445
  • 22
  • 96
  • 149
18
votes
4 answers

Why am I getting Could not load file or assembly error on a System.Configuration DLL when using framework 4.0?

Immediately after we upgraded to visual studio 2010 and the 4.0 framework our trunk build started breaking with the Could not load file or assembly error. We determined that a 3.5 project couldn't reference a 4.0 project else we'd get this error…
topwik
  • 3,487
  • 8
  • 41
  • 65
18
votes
6 answers

Secure C# Assemblies from unauthorized Callers

Is there any way to secure your assembly down to the class/property & class/method level to prevent the using/calling of them from another assembly that isn't signed by our company? I would like to do this without any requirements on strong naming…
Rodney S. Foley
  • 10,190
  • 12
  • 48
  • 66
18
votes
3 answers

Generate .NET Assemblies from Iron Python

I have a Iron Python script that I want to run and then have the ipy interpreter output an assembly that I can run on other machines. How do I do that? Is there a switch I can pass to ipy.exe?
Leo Bontemps
  • 437
  • 1
  • 4
  • 9
18
votes
6 answers

Where are assemblies in .NET physically located?

I am a little confused about where .NET assemblies are physically located. Take good old LINQ. In my web.config file it says: This is the…
Petras
  • 4,686
  • 14
  • 57
  • 89
18
votes
2 answers

How to use Assembly Binding Redirection to ignore revision and build numbers

I have several .NET applications in C#, along with an API for them to access the database. I want to put all versions of the API in the database, and have them pick the highest revision and build number, but stick with the major and minor number…
Anthony D
  • 10,877
  • 11
  • 46
  • 67