assemblies

Confusion about GAC

While the interview , I was confused after interviewer asked this question about Global Assembly Cache (GAC). What should be the answer? Question 1: Instead of keeping the assembly in GAC, If we create the directory and keep our assemblies there and if we make that directory as shared so can the connected computers can use those assembl...

Why do standard libraries for C# need both an assembly reference and an import?

What is the reason that I have to do both of these for the standard libraries? For every other language that I have used, I only have to do one to access standard libraries. ...

How to change the Public token of the assembly

I have 2 dlls. One dll is refering to the another one. I checked the mainfest of first dll and found it is referncing to the 2nd one with some specific token key. But I checked the token of second assembly and found that it has some diffrent public token. So somehow I missed the correct 2 second assembly. So I want to know is there a w...

3rd Party .Net Assembly not working in WebService project

So I'm trying to use a .Net Assembly in my web services project. This assembly requires lots of settings in App.config. But my web service doesn't have an App.config, it has a web.config. It seems that it uses sections that an app.config would have that don't even exist for web projects. Is there any way I can make this assembly work...

VS2008 WPF Xaml: Is there a path length limit when loading an assembly?

Hello, It seems that there is a path lenght limit for VS2008 when loading XAML assemblies. Using the Microsoft sample Southridge, if the project is stored on "C:\Projects\C# samples\Southridge_Labs\1.Southridge_Fundamentals\Start" the designer does not load the assemblies. But if I copy my files the project to the root (C:\Southridge_...

Which dll will aspx compiler use when a dll is referenced one but multiple versions exist in bin folder

I have an ASP.NET Web Application which has a reference to 'C:\references\Utils.Varia.dll'. There is another dll referenced which uses the signed version of this dll ('C:\references\Utils.Varia.Signed.dll'). Now in my aspx i have the following imports directive: <%@ Import Namespace="Utils.Varia" %> This page uses a string extension fr...

Is there a way to get a Type from the namespace/type strings alone?

I am needing to reference a type in an external assembly. I know the namespace and the type name and I know the assembly will be in the GAC, but that's it. Is there a way to get this type. I see there's a way to get it from a GUID or Program ID which works for me, but I know the people who develop the external assembly may drift away ...

Any way to be able to install the same ClickOnce app from two different locations?

We build the application once, and then deploy it to multiple sites. I can install it from any of the deployed servers, but I cannot have it installed from multiple at the same time. I understand that this is a limitation of ClickOnce. Is there any way to trick ClickOnce into allowing this to work? Or any site-specific post-processin...

Replacing an asp control at runtime

I have an existing .NET 1.1 dll that I do not have the source code for. It contains the code-behind for a asp.net page containing various form controls including a third party text editor that I no longer want to use. I want to replace the text editor with a simple asp:Textbox but the existing textbox is baked into the old assembly. How ...

How to embed .NET modules into an independant assembly ?

I'm trying to automate assembly generation from netmodules. I tried to use "al.exe" tool with this commande line : al module1.netmodule module2.netmodule /target:library /out:assembly.dll. My problem is that my assembly does not embed my netmodules but only references them : - if I open my assembly with "ildasm.exe" tool, I can only see...

Property to return the assembly version of descendant classes

In one C# project have a base class like this: public abstract class AbstractVersionedBase { public string Version { get { return Assembly.GetExecutingAssembly().GetName().Version.ToString(); }} } This project has a version of 0.0.1.1. In another C# project I have a class that inherits from AbstractVersionedBase lik...

Provide the ability to "hot swap" / change assemblies at runtime without re-starting a process.

ASP.Net allows you to copy new assemblies into the bin directory of an application without needing to re-start any services or processes. I have an application that loads user defined plugins and extensions (some of them are COM based) - I'd like to provide similar functionality (i.e. the ability to change / update an assembly without n...

I cann't access a namespaces in referenced assemblies in MVC Views

Some times there are an intellisense problem in the views, the namespaces in the referenced assemblies don't appear in the intellisense only in views but the do appear in .cs code files in the same project.. i've tried these ways: <pages> <namespaces> <add namespace="MyNameSpace" /> </namespaces> </pages> in the web.config fi...

1 Dll, in our libraries... If called from webservice behaves as expected, if called from winform, uses remoting... HUH?

That's Pretty much it. I took a set of Active Directory classes we'd had in our webservices for years, and seperated & migrated it into our Libraries so I could also use them in a winform app I'm whipping up. Migration worked fine. Running it via the original webservice, works normally, I can debug into the Classes just fine. Same exa...

Why does my .NET 4 targeted application need 2.0 installed to run?

I have a pretty complex WPF and C++/CLI application that was built using .NET 3.5. We've migrated to 4.0 to take advantage of the WPF goodies, so all our projects in the solution are targeting 4.0. On running our application on XP machines with just 4.0 (and MSVC++ 2010 [and 2008]), an error dialog will pop up with the message: "To run...

Get Application Path of offending DLL from Exception

We currently have a simple Log class that can take in an exception. In our business logic if we happen to need a try/catch around a specific set of code, we log the exception and then rethrow it. The problem is that our Log class is in a common dll and when it writes the log I want to be able to also grab the path of the offending code...

C#: why sign an assembly?

I have noticed that in some C# code I have taken over (in VS2005) that the assemblies are all signed with the same .snk file. Why would the previous author have signed the assemblies in this way? Is signing assemblies necessary and what would be wrong with not signing? What disadvantages are there in signing assemblies - does it caus...

Creating a Silverlight Assembly

Okay, about three to four months ago, while looking for something COMPLETELY different, I was tripping over how-to's on creating Silverlight assemblies. Now that I am actually looking for that info, I can't seem to find it. Can anyone point me to some resources for taking a UserControl I've created and making an assembly from it? Thank...

Resource Dictionaries in a Silverlight Assembly?

I've just begun dabbling in putting together a set of controls as assemblies and I'm working on default styling. What I currently have is a UserControl in a project (thanks Reed!) and I'm able to bring that into another project via reference. I plan to add more controls over time to build something of an SDK. I currently have some hooks...

.NET: Binding of assembly to an new version of referenced assembly without recompile

Hi, I have a strong-named .NET assembly PluginHost which dynamically loads plugin-assemblies using Assembly.LoadFrom(). It has an Assembly- and File-version of 1.0.0.0. Every plugin-assembly references PluginHost because in PluginHost there is an interface defined, every plugin has to implement. Now I want to deploy an updated but fully...