assemblies

Securing .net Assemblies

Hi All! I want to secure my assembly (dll) by binding it to a specific environment. Say I have a dll (BizLogic.dll), I want to make it available to my co-developers to use it within the organization. But I don't want others to use it outside my organization. Is there any way to address this issue? Thanks in Advance. -- Mohammed. ...

C#: Custom assembly directory

Say we have an application which consists of one executable and 5 libraries. Regularly all of these will be contained in one directory and the libraries will be loaded from there. Is it possible to do so that I can have for example some of the libraries in one directory called Lib, and the rest in one called Lib2? So that the applicatio...

are you missing an assembly reference?

I'm getting the joyous 'type or namespace name "Something" does not exist in the namespace "Something else" (are you missing an assembly reference?)' error. What I've got is a Website project that contains the website itself along with several other custom projects upon which the website relies. The issue I'm having is with one of the ...

could not load dll or one of its dependency

a. My C# program will load a dll (which is dynamic), for now let's take a.dll (similarly my program will load more dll like b.dll, c.dll, etc....). b. My program will invoke a method "Onstart" inside a.dll (it's constant for all the dll). I am able to achieve the above 2 cases by reflection mechanism. The problem is a. If my a.dll ha...

Missing namespaces, LINQ works in web app but not website!

Okay guys, I have an asp.net website set up to target the 3.5 framework, using Linq to Sql. However, the site won't build, and i get missing namespace and assembly exception whenever i try to. Here's the catch, I have installed 3.5 SP1, and I have added the System.Core, System.Data.Linq, System.Xml.Linq, and System.Data.DataSetExtensio...

.NET assembly loading priorities

I have a solution with 3 projects (GUI, BL and DAL). The DAL assembly is signed and deployed in the GAC. When I build the solution the DAL is compiled and the assembly placed in the bin folder of the main project. But when I run the application, it loads the GAC version instead of the local one. Why is this? I realized that because the...

How to prevent a .NET application to use an assembly from the GAC?

Can I configure a .NET application in a way (settings in Visual Studio) that it references a "local" assembly (not in GAC) instead of an assembly within the GAC, although both assemblies have the same name and the same version? ...

How do I prevent other programmers from wrapping my assembly?

Can someone tell me what the best approach to protecting my component DLLs in .Net? I've written a few DLL components which will be publicly available. They will be licensed accordingly but I want to programmatically make sure that no one is using the components within their solutions illegally. Any ideas? ...

How can I merge resource files in a Maven assembly?

I'm using Maven and its assembly plugin to build a distribution package of my project like this: one project assembles a basic runtime (based on Felix), with the appropriate directories and bundles, in a ZIP file. third-party libraries are collected in one project each and either converted to OSGi bundles or, if they are already OSGi c...

Accessing Custom configSections in Web.Config from Custom Assembly in SSRS

I am trying to allow my custom assembly to utilize the Report Server's web.config file during report rendering. Currently, the custom assembly code can access the ConnectionStrings and AppSettings from the web.config, but when I try to access customer config setting via System.Configuration.ConfigurationManager.GetSection("") I get a typ...

Assembly.CodeBase: when is it no file-URI?

Assembly.Location gives a plain path to the assembly. Unfortunately this is empty when running in a shadowed environment, such as unit test or ASP.NET. Hovever, the Codebase property is available and provides a URI that can be used instead. In which cases it returns no URI starting with file:///? Or in other words: what are the cases in ...

ILMerge and localized resource assemblies

We have an application whose structure when compiled looks something like this: Foo nb-NO Text.resources.dll sv-SE Text.resources.dll Bar.dll Foo.exe Text.dll Is it possible to use ILMerge on this? How would you do that? ...

.NET mixed multi-file assembly

I need to create a .NET assembly composed of 2 modules: 1 internal (in the DLL) with native code and 1 external (in a .netmodule file). This would be easy to do, except for the native part. C#'s compiler can do this (this is what I want, but with native code): csc /t:library /out:foobar.dll foo.cs /out:bar.netmodule bar.cs -foobar.dll...

Assembly references for dymanically loaded DLLs

Hi, I have 4 assemblies: Tester.exe ToyInterface.dll ToyFactory.dll --> reference (ToyInterface.dll) Toy.dll --> reference (ToyInterface.dll) Tester.exe internal ICollection<string> Scan(string path){ return ToyCollection = _reportFactoryType.GetMethod(FACTORY_GET_TOYS). Invoke(_ToyFactory, null); } ...

Is there way to read a text file from an assembly by using Reflection in C#?

I have a text file inside the assembly say MyAssembly. I am trying to access that text file from the code like this : Stream stream = Assembly.GetAssembly(typeof(MyClass)).GetFile("data"); where data is data.txt file containing some data and I have added that .txt as Embedded Resources. I have dome reading of the images from the Ass...

Redirect assembly binding to an custom/unsigned dll

Problem The basic problem is I want to debug some 3rd party code to see how it works so I can replace part of it. Is there anyway to redirect the binding so that it will not use the dll in the GAC but instead the copy I compiled instead (which will be either unsigned or have a different public key). Details The specific item in que...

How can I prevent the referencing of a certain assembly when running in Mono.

I know how to branch the code based on Mono (Type.GetType("Mono.Runtime") != null) but even when the Mono code path is taken, Mono is attempting to load assemblies that would be required by the non-Mono code path. This is not all that surprising, but how do I get around the problem? I have tried putting the call to the non-Mono assembl...

We have two version of the same assembly in GAC? I want my client to make choice of which assembly to choose?

We have two version of the same assembly in GAC? I want my client to make choice of which assembly to choose? ...

What would be the most consistent place to store an App Domain name and related App Domain + type?

Say I have an application that reads a centralized ErrorLog called LogViewer it is mirrored in a few formats (winforms, silverlight, asp.net, asp.net mvc, etc) Project Names for the actual publish/deployment would be different for each one. Where would I best store the name LogViewer vs LogViewer WinForm (or LogViewer silverlight,etc) t...

How to load an assembly without using Assembly.Load?

Is it possible to do this by streaming the assembly into memory? If so, how does one do this? Reason: I don't want to lock the dll that's loaded. I want to have the ability to dynamically load, change the code, compile and reload it again ...