assemblies

How to Load assembly to AppDomain with all references recursively?

I want to load to new AppDomin some assembly which has a complex references tree (MyDll.dll -> Microsoft.Office.Interop.Excel.dll -> Microsoft.Vbe.Interop.dll -> Office.dll -> stdole.dll) As far as I understood, when an assembly is been loaded to AppDomain, it's references would not be loaded automatically, and I have to load them manua...

Converting Assembly to byte[]

Hello, I am trying to convert an assembly compiled using ICodeCompiler into byte[]. How can I do that? Also what is safest way to transfer this assembly to some remote location (client)? Note that Symmetric Key encyrption is not a possiblity. Update: What about this? BinaryFormatter formatter = new BinaryFormatter(); Me...

How do I load a generic type containing nested types from dynamically loaded assemblies?

In an assembly loaded into the current AppDomain using Assembly.LoadFrom, I have the following code: [TypeConverter(typeof(EnumConverter<Shapes>))] public enum Shapes { Triangle, Square, Circle } The generic EnumConverter<T> is defined in the assembly returned by calling Assembly.GetEntryAssembly(). When I read the TypeConverte...

Any Tips on Threading Considerations + Design for following cases

I'm writing a class library that will offer some asynchronous processing, and want to try and avoid running into threading issues later on down the line. So I'm after any suggestions people can make to avoid running into issues later on, and instead start with a good design. Some of the situations that I can see that might cause problem...

How can I load a config file from different assembly in asp.net?

Hi I am using the Validation Application Block form the Enterprise Lib, and have my validation rules defined in a validation.config that is located in the same assembly as the entity objects (so I can use the same rules in both the backend and on the website). But how do I get the validation.config from the entity assembly into the web...

Assembly to Bytes

My scenario - I am trying to send a Assembly File from Server to Client (via direct TCP connection). But the major problem is- how do I convert this Assembly to bytes to that it can be readily transferred? I used following - byte[] dllAsArray; using (MemoryStream stream = new MemoryStream()) { BinaryFormatt...

Transfering Assembly over TCP

I am currently trying to send a serialized object over a TCP connection as follows - BinaryFormatter formatter = new BinaryFormatter(); formatter.Serialize(clientStream, (Object)Assembly.LoadFrom("test.dll")); where clientStream is TcpClient tcpClient = (TcpClient)client; NetworkStream clientStream = tcpClient.GetS...

Difference Between Assembly and DLL

What is the difference between Assembly and a DLL? While sending the code to a remote client, should a DLL file be sent or should a Assembly be sent (When direct TCP connection is available between two)? ...

Tool for enumerating assembly information to xml

Does anyone know if there is a tool to get all assembly information given an assembly. Prefereably in XML format. Information needed: Full namespaced assembly name Title Culture Configuration Version Informational version Description Company Product Copyright Trademark ...

Visual Studio 2005 - C++ - What controls the manifest creation

I was trying to figure out why a debug build was blowing up with the "dependent assembly microsoft.vc80.debugcrt could not be found" event error. After deleting everything (anything not .cpp or .h) and recreating the solution - I still had the problem. A google search was fruitless and a re-install of VS didn't produce any change. I d...

DLL versus Assembly

what is the difference between DLL and Assembly Exact duplicate: Difference Between Assembly and DLL ...

Load assembly and change source, is it possible and how?

I'm writing .NET On-the-Fly compiler for CLR scripting and want to implement next idea: there is a template file with C# code, I want to read it, create an assembly, load it and amplify source on-the-fly. How can I do that? ...

Is there a way to ease the pain of maintaining .NET assembly references?

I'm currently working on a web project that involves several assemblies, structured something like this: WebProject | +--> A (external assembly, Version 1.0.0.0) | +--> B (external assembly, Version 1.0.0.0) The difficulty is that in order to keep track of what's deployed, I'd like to updated the version numbers of assemblies A an...

How can I load WPFToolkit assembly in Powershell

I have installed WPF Toolkit: Location: C:\Program Files\WPF Toolkit\v3.5.40320.1\WPFToolkit.dll Name: WPFToolkit, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35 Type: Library I can load it by full path: [System.Reflection.Assembly]::LoadFrom("C:\Program Files\WPF Toolkit\v3.5.40320.1\WPFToolkit.dll") But c...

Using an AppDomain to instantiate a class in a DLL

I have a website that on user-demand compiles a class on the fly and deposits the dll(named Equation.dll) in a subdirectory of the website. The administrator can recompile at any time. However, once an instance of the class has been created, the message "The process cannot access the file because it is being used by another process" is...

How to include source code location information (file/line/column) in .NET assembly?

I need to be able to get from .NET assembly a class/struct/interface definition location (filename,begin_line,begin_column,end_line,end_column) in my source files. First solution that came to my mind was using some pdb quering api, but it seems that I can obtain such info only for method definition this way. Or maybe I'm wrong... To pr...

Website project (ASP.NET) - what assembly will my code compile to?

I've got a Website project in VS.NET 2008. I have a class in App_Code folder namespace RM{ public class MyClass{ ... } } I need to know what assembly this will compile to? You'd think it should be RM.dll but doesn't look like it. I know that it's better to use WebApplication project instead, but it's not an option at ...

Does pdb provide information about type definitions in source files?

I know about DIA api, dbghelp. But can i use them to extract type definition location info such as file, begin_line, begin_column, end_line, end_column from my assembly and pdb generated? If the answer is yes, can someone point me to the simple example out there? ...

Compile .dbml file into separate assembly

I have a website project, and using Linq to SQL in it. Currently, I have my .dbml file in the App_Code directory, but I want to separate it out into a different project in order to compile it into a separate dll; is it possible? I tried adding a DB project to my solution, but didn't have much luck with it. ...

How do you load embedded assemblies that you've bundled in with your main assembly?

What's the best practice for bundling one assembly in another? I have an assembly I'm distributing, but I have a couple third-party assemblies that I use in it, and I don't want to have to distribute more than one. So, I'd like to compile a couple assemblies into the one I distribute so that they're just built-in. What's the best prac...