assemblies

Loading different assembly versions dynamically in .NET

Is it better to use System.Assembly.Load or to load the assembly directly into the AppDomain using System.AppDomain.CurrentDomain.CreateInstanceFromAndUnwrap? I am specifically interested in calling different versions of the same assembly running in the same process. I think with CreateInstanceFromAndUnwrap your assembly must have the [s...

Single assembly from multiple projects

In a .net application involving several projects in one solution, I have a project with the namespace set to Company.Product.UI and another one with Company.Product.UI.WebPages. My problem is that two dlls result from building the two projects. How can I have a single dll and still preserve the current solution structure. I use Visual St...

Can I sign an assembly for which I do not have source code?

I have received an assembly from a third party. I need to add it to the GAC, but it does not have a strong name. Is there any way for me to sign the assembly using my own key so that it will be strong named? ...

How do I Compile and Deploy an assembly into a custom path using visual studio?

Hi, I've been searching this for a long while and i could find anything. I have 2 projects. One called ConsoleApp and other called ConsoleLib. ConsoleApp has a reference to ConsoleLib. How can i Tell visual studio to copy the assembly into a custom path instead of the app path? What i want to mean is that when i build the solution i want...

Dynamically loading .NET assemblies

Guys, I am writing a program and I want the program to support plugins. I created an interface that the program must implement. I am using the following code from my main program to call the plugin: Dim asm As Assembly = Assembly.LoadFrom(ff.FullName) ' Get the type Dim myType As System.Type = asm.GetType(asm.GetName.Name + "." + asm.G...

How can I get the assembly file version

Hi Folk, The assembly version I can get with following loc: Version version = Assembly.GetEntryAssembly().GetName().Version; But how can I get the assembly file version? Thanks for help. ...

"The specified module can not be found" in asp.net application.

I just tried to copy my entire web application to a new instance of Visual Studio 2008 on another (virtual) machine. It builds just fine, but when I try to run the applicaton I just get the message "The specified module could not be found". Does anyone have an idea how I can find out which module this message refers to? Because there a...

How to set "Specific Version" property for project references in Visual Studio

I have got a Visual Studio Solution containing several projects and have set up the references between the projects as project references. When a reference to an assembly is added, the references' properties contain a setting for Specific Version = True|False This property is missing for project references. How can it be set? I'd lik...

Get the Assembly path C#

Hello, Im trying to know the path of a dll.... several sites says that ive to use System.Reflection.Assembly.GetExecutingAssembly().Location BUT it returns a path in C:\Windows\Microsoft.Net ... etc... \File.Dll and i want c:\MyProyect\MiWeb\Bin\File.Dll any help ? ...

Why am i getting Stream as System.IO.UnmanagedMemoryStream?

Hi I have a part of code like this Assembly myAssembly = Assembly.GetExecutingAssembly(); string[] names = myAssembly.GetManifestResourceNames(); foreach (string file in names) { if (file.EndsWith(".dtd")) { // attach to stream to the resource in the manifest ...

Sharing assemblies in .NET

Our applications use lot of custom built and third party libraries and right now each application has a private reference to these assemblies which means that the bin folder of each of these applications has the referenced assemblies copied. For e.g. Application A references log4net.dll, CustomLibA.dll, CustomLibB.dll and Application B a...

How to detect if another assembly is available to my application or not.

I have a command line winforms executable that calls into a Windows winforms application. Occassionally Ops forget to include the windows exe with the command line exe when deploying the application, leading to an error. How do I gracefully handle that and show a nice error instead of: Unhandled Exception: System.IO.FileNotFoundE...

Serialization Assembly. Is it needed or not?

I have a .net 2.0 c# ClickOnce app and it connects to its data via Web Services. I've been told that one way to potentially speed up the application is to generate a serialization assembly beforehand. I have several questions on this front. The default setting to whether to generate a serialization assembly is Auto. What criteria doe...

signing assemblies - basics

what does it mean to sign an assembly? and why is it done? what is the simplest way to sign it? what is the .snk file for? thanks ...

OO Design Pattern on a Package/Assembly/Namespace level?

I was looking at this question and I wondered to myself are there any design patterns/rules of thumb that you can use when breaking up your project into packages/assemblies. I usually don't seem to have any issues with this as I tend to just break stuff up into packages/assemblies such that each does as little as possible that is releva...

Silverlight Assembly.CodeBase problem

"This member has a SecurityCriticalAttribute attribute, which restricts it to internal use by the .NET Framework for Silverlight class library." Is there a way to access this information? (The original location of the Silverlight assembly). ...

How to get a programmatic list of all loaded assemblies (referenced) in the .NET Compact Framework

I am running on Windows CE and using the Compact Framework. I need to get a list of all reference assemblies that my application has loaded. It would be nice to be able to get to the AssemblyName (object) of these assemblies. An example is like getting my running assembly by doing: Assembly.GetExecutingAssembly(); except I need to get t...

Tracking File-level Versioning in builds using Visual Studio and .NET?

I want a tool or a technique to be able to answer the question "What version of file X was used to build Assembly abc.dll?" I recently moved to a .NET development group, and it seems like this question comes up all the time, in one form or another, and we don't quite have a handle on it. Someone will say something like "Hey, is your la...

Version numbers is 1.13 > 1.2?

I know from the .NET perspective that an assembly with a version of 1.13 is considered a newer release than version 1.2 because each number in the version is evaluated individually. However from a numerical point of view 1.13 is < than 1.2. The issue comes down to readability when publishing updates for customers. From .0 to .9 it's al...

Speed Increase by Using the Global Assembly Cache

If I had a 1000 asp.net websites each with 30 DLL's in their /bin folders. Therefore 30,000 DLL's. Would the websites / web server / machine run faster if I registered one set of the DLL's into the Global Assembly Cache and each site used the DLL's in the GAC? e.g. would the websites collectively use less memory? ...