assemblies

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 Microsoft.CSharp; CodeDomProvider provider = new CSharpCodeProvider(); CompilerParameters...

NDepend: How to not display 'tier' assemblies in dependency graph?

I was able to do this in an earlier version of nDepend by going to tools->options and setting which assemblies would be part of the analysis (and ignore the rest). The latest version of the trial version of nDepend lets me set it, but it seems to ignore the setting and always analyze all assemblies whether I want it to or not. I tried ...

Weird compatibility problem with .Net 3.5 and 4.0 assemblies (NATUPnPLib)

I'm having trouble getting NATUPnP 1.0 Type Library to work with Framework 3.5 in Visual Studio 2010. If I use .Net 4.0, it works just fine, but with .Net 3.5, NATUPNPLib's namespace looks excactly like NETCONLib's. For example this Port Forwarding Management Application sample from this site: http://pietschsoft.com/post/2009/02/05/NET-...

AssemblyResolve event is not firing during compilation of a dynamic assembly for an aspx page.

This one is really pissing me off. Here goes: My goal is to load assemblies at run-time that contain embedded aspx,ascx etc. What I would also like is to not lock the assembly file on disk so I can update it at run-time without having to restart the application (I know this will leave the previous version(s) loaded). To that end I hav...

PlaneProjection is not working well in silverlight

in silverlight project using name attribute in planeprojection gives Error 1 The type or namespace name 'PlaneProjection' could not be found (are you missing a using directive or an assembly reference?) code i used for that <Image Name="blabla.jpg" Height="200" Width="200" > <Image.Projection> <PlaneProjection Name="pp" /> ...

In what location does a .NET app look for .NET assembly file?

In what location does a compiled .net app look for .NET assembly file? If the assembly file is not found in the application folder and not found in the GAC, where else will it look? ...

Why are framework dlls repeated in several places?

After installing .Net 4 and getting some questions that were already answered here I also realized how the Framework dlls are repeated in several places for the different Framework versions (this is not new, it happens with previous versions, but hadn't paid attention to it until now) 1 - GAC: %systemroot%\assembly 2- Framework instal...

Ensuring an assembly is called via a specified assembly

Is there any built in functionality to determine if an assembly is being called from a particular assembly? I have assembly A which references assembly B. Assembly A exposes PowerShell cmdlets and outputs types that are found within B. Certain methods and properties with in types of exposed by B are of interest to types in assembly A b...

Read assembly in .net

Hi, I am using asp.net with C#. I have a application deployed on the server [published], now I want to see the code for that website, As far as I know I can read assembly to see the code. please let me know how to acheive it. Thanks in advance. ...

Can I use both C# and C++/CLI in a single assembly?

Can I put together both C# and C++/CLI source files in a single project, and then compile them to obtain a single .DLL assembly? ...

Need to call COM component using reflection in .NET

I need to determine the COM component(unmanaged code) type and invoke the exposed interface's methods using reflection in C# at runtime. First What member of "Type" tells that type is COM component and we can take CLSID at runtime? Is Type.COMObject? I need to call methods of exposed interfaces as they called in unmanaged code using C...

If I add a public method to a C# class, do I need to recompile other assemblies using that type?

Question in the title. I'd like to avoid recompiling since the source code I'm modifying is third party and I'd like to use the original binaries where possible, and replace only the assembly which contains the class I modified. But I'm not sure if this is a safe thing to do. In C++ for example this is definitely a bad idea. ...

Using different versions of the same assembly.

I have a project where I simultaneously must use reports built in ActiveReports 2 and ActiveReports 6. Overall, it works ok, but some of the helper assemblies use the same name. For instance, to be able to export to PDF, both versions use an assembly called ActiveReports.PdfExport.dll. The corresponding assemblies are different, of co...

Why would I need a using statement to Libary B extn methods, if they're used in Library A & it's Library A my client uses?

Hi, I have: Main Program Class - uses Library A Library A - has partial classes which mix in methods from Library B Library B - mix in methods & interfaces Why would I need a using statement to LibaryB just to get their extension methods working in the main class? That is given that it's Library B that defines the classes that wil...

How to query an .NET assembly's required framework (not CLR) version?

Hi, we are using some kind of plug-in architecture in one of our products (based on .NET). We have to consider our customers or even 3rd party devs writing plug-ins for the product. The plug-ins will be .NET assemblies that are loaded by our product at run-time. We have no control about the quality or capabilities of the external plu...

Load and execute code from an assembly without locking the file?

Is there a way to load an assembly from disk and execute code in it without getting the file locked on disk? I never understood why it is necessary to lock the file since the code will be loaded in RAM and JIT-compiled? ...

Parsing plain Win32 PE File (Exe/DLL) in .NET

I need to parse plain Win32 DLL/Exe and need to get all imports and exports from it and to show it on console or GUI(say Win Forms). Is it possible to parse Win32 DLL/Exe in C#.NET, read its export table,import table and get managed types from it. As its unmanaged PE(.NET doesn't allows you to convert unmanaged PE files to managed .NET a...

Serializing and Deserializing External Assembly in C#

I wrote a plugin system and I want to save/load their properties so that if the program is restarted they can continue working. I use binary serialization. The problem is they can be serialized but not deserialized. During the deserialization "Unable to find assembly" exception is thrown. How can I restore serialized data? ...

Loading assemblies dynamically‏ AssemblyResolve issue

Note: This is a continuation of my previous post: Complicated API issue with calling assemblies dynamically‏ I'm writing a .Net windows forms application that runs on a network and uses an SQL Server to save and pull data. I want to offer a mini "plugin" API, where developers can build their own assemblies and implement a specific in...

Any way to make GetTypes() less brittle.

I'm iterating through all the types in GAC, GAC_32 and GAC_MSIL looking for specific types, fundamentally to match those using clauses in my source code, so when I compile the source. I'll know exactly what assembly dll's to provide. I'm getting all the file names from each of those directory and applying GetTypes to each assembly in ...