assemblies

Having problems when two of referenced assemblies both define type A.A1

If two assemblies both define namespace A containing class A1, then the two classes are considered unique types. a) Are the two namespaces also considered unique? b) If program P has a reference to both assemblies, how do we create an instances of the two types? Namely, I keep getting an error when I try to create an instance of A.A1 ...

why reflection.assembly loadfile doesn't load all dlls?

Hi, I am using LoadFrom(), to load dlls, but for some reason this load function doesn't work on all dlls, i want to load 3000 dlls to get from each one the copyright attribute. my code : class ReverseDLL { private Assembly assembly; private AssemblyDescriptionAttribute desc; private AssemblyTitleAttribute title; pri...

How to be sure that Assembly.LoadFrom really loads a DLL file in?

Hello, I'm trying to add my plugins to my application via Assembly.LoadFrom and I would like to know if there's a property to know what type of assembly was loaded - dynamically linked library and executables can be loaded, right? Thank you! ...

When should [assembly: InternalsVisibleTo()] be used?

I understand that the InternalVisibleTo attribute is used to expose types and methods with the internal access modifier to a specified assembly. I have only ever used this for exposing internal methods to a separate assembly containing a suite of unit tests. I am struggling to think of another scenario when this should be used. Was this...

I have a c sharp dll. How can I make it usable in other languages, such as PHP or Delphi?

I have a dll developed in C Sharp. How can I make it usable in other languages, such as PHP or Delphi? I cannot find any solution to this problem yet. Isn't there any easy way of doing this? ...

Target non specific version of an assembly

Hi there: I m trying to not target a specific version of a dll but I m not quite sure how. I have set the option Specific Version on the properties of the assembly to false, however if i try to run the application and the version of the requested assembly is a previous one, I get a: FileLoadException: Could not load file or assembly ...

Register multiple versions of same assembly in GAC

Hi, I need to register two versions of the same assembly in the GAC. From what I understand, it should be possible to register both versions, however when I try to register the second one using gacutil.exe I get the following message: Assembly already exists in cache. Use /f option to force overwrite The assembly I'm trying to regis...

Including resources file for Unit test in C# project

I have some functions that read & modify files. In order to make the unit tests independant of any file system issues, I want to include the files inside the project. However, my function should be getting the filePath, and all I can get from the assembly is a FileStream. Any idea how I can get the file path of a resource file in the p...

Visual Studio 2010: Reference Assemblies Targeting Higher Framework Version

Visual Studio 2008 did let you reference an assembly A targeting a higher framework version than that of the assembly B that references it. Visual Studio 2010 doesn't allow for this any more. The full issue is described on MSDN: You can create applications that reference projects or assemblies that target different versions of t...

Visual Studio build error: claims member of class in other assembly doesn't exist

Hi all I have a website solution which contains a project with domain classes. I have added a public auto property (get; set;) to one of the domain classes. A page on the website references this property - it was added to the page using IntelliSense. The website project builds okay. But when I build the solution, I get the old 'Class ...

StructureMap 2.6.1.0 Assembly scanning problem

I am trying to use StructureMap to scan at runtime for assemblies that contain an implementation of the Registry class, but I'm running into a problem. If a dll contains a Registry class, but also contains a reference to a dll that isn't present at runtime (say a Rhino.Mocks dll that isn't required at runtime), StructureMap will throw ...

Maintaining .NET assembly references common to multiple projects

Hey all, My colleagues and I have been wondering the best way to do this for quite some time: what's a good/standard way to maintain .NET assemblies that are referenced in multiple projects? I'll elaborate a little bit: Say you have projects A, B, and C. They could be in the same solution or different solutions, doesn't really matter. ...

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 because, as the error states, This assembly is built by a runtime newer than the currently lo...

Can't load DLL compiled with another one recently moved to the GAC

I have a app that allows users to plug in custom libraries they built. They had to reference a DLL I provided to get attributes needed to make their libs work in my system. Now I need to move this DLL into the GAC, but when I do my app won't load legacy custom libs, even though they were compiled with "Specific Version = False". CreateI...

Describe the .NET assembly circular dependency problem in layman's terms

Please describe the .NET assembly compilation circular dependency problem in layman's terms, and whether other technologes have similar limitations. Note: This seems like a simple question, I know, but I have seen a number of real, significant projects that have totally broken dependency graphs. ...

Why does my command line application error out on remote assembly when ran outside Visual Studio?

I have a very simple command line .net application. I have reference to a .dll assembly and everything works just great when I run the program inside Visual Studio. However when I try to double click the .exe file or run it manually via DOS or something it error out saying it doesn't have access or can't find my assembly reference. Wha...

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

Hello, I'm new to .NET C# programming. I'm following few books. It is said that instead of compiling it directly to binary code (Native code). High level code is converted into intermediate language (called MSIL aka CIL). But when I compile, I get an exe/Dll file. Is this MSIL/CIL containted in these exe/dll file? I want to see that i...

Can I find to what target .NET dll was built looking into the file?

I have a bit of mess with projects coming some on 4.0 some on 3.5 Is it possible to find out what version of .NET was the dll built looking into the file (not from code!) ? ...

Where is the information about the entry point of an assembly written in the assembly?

I used to think that an assembly could have only one main() method until I saw Jon Skeet's MiscUtil in a video lecture he delivered at the Microsoft office in Copenhagen. So, I wrote this little app that had two main() methods like so: namespace ManyMains { class Program { static void Main(string[] args) { ...

C# application not recognizing satellite resource assemblies

Due to the extreme amount of .resx files in our application, I have created the following MSBuild script to compile all language .resx files into .resource, then embed them into satellite resource assemblies. <Project DefaultTargets="Main" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt; <ItemGroup> <Res Include...