.net-assembly

Using reflection to determine assembly module type

How would one use .net reflection to determine the type of the executing assembly, by type I mean dll or exe. Currently its possible to do something like: Assembly.GetExecutingAssembly().CodeBase.ToLower.EndsWith(".exe") But it seems like something better could exist that does not need to do a string comparison, i.e. comparing the asse...

WebResource.axd blank or not found

I'm trying to export a control library in a .dll for other developers in the office to consume. The solution I original created looks like this: Solution 1: - Mri.Controls (Class Library) - Mri.FmTool (Web Application) Mri.FmTool references Mri.Controls. Inside Mri.Controls, I have some javascript WebResources. Mri.FmTool seems t...

How to import a net assembly

Hello, I downloaded zlib.NET and there's a file that I must import,its named "zlib.net.dll". My question is :How do I import that file so I can use it in C# Express 2008 like "System.zlib.etc"? Thanks. ...

Why must I chain reference assemblies?

My project references an assembly (will call it X) that references another assembly (will call it Y). When I try to compile my project, it demands that it should reference assembly Y. Why is that? I get the following error on the line where assembly X is referenced: The type 'DevExpress.XtraEditors.XtraForm' is defined in an assembly...

Why does my App.Config codebase not help .NET locate my assembly?

I have the following client application and its corresponding config file: namespace Chapter9 { class Program { static void Main(string[] args) { AppDomain.CurrentDomain.ExecuteAssembly("AssemblyPrivate.exe"); } } } <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-micro...

How to separate model, view and controller in an ASP.NET MVC app into different assemblies

Hi, At the moment I am trying to get into the ASP.NET MVC framework. For most of my test applications I used a single assembly/project. This worked fine for some smaller applications. Then I wondered how I could place my model, controller and view classes into separate assemblies? In really big web-applications it is not very realistic ...

How to get the assembly (System.Reflection.Assembly) for a given type in .Net?

In .Net, given a type name, is there a method that tells me in which assembly (instance of System.Reflection.Assembly) that type is defined? I assume that my project already has a reference to that assembly, just need to know which one it is. ...

How to access classes in another assembly for unit-testing purposes?

I'm jumping into unit-testing the Visual-Studio 2008 way, and I'm wondering what's the best way to accomplish cross-assembly class access for testing purposes. Basically, I have two projects in one solution: MyProject (C#) MyProjectTests (C# Test Project) Everything in MyProject currently has default accessibility, which if I recall...

Best way to check if a dll is an clr assembly in C#

What is the best way to check if a dll is a win32 dll or if it is a clr assembly. At the moment I use this code try { this.currentWorkingDirectory = Path.GetDirectoryName(assemblyPath); //try to load the assembly assembly = Assembly.LoadFile(assemblyPath); return assembly...

.NET Framework get running processor architecture

There is an enum of all supported processor architectures here: http://msdn.microsoft.com/en-us/library/system.reflection.processorarchitecture.aspx Is there any way to determine which one corresponds to the running environment? System.Reflection.Assembly.GetExecutingAssembly().ProcessorArchitecture returns MSIL -- obviously wrong. EDI...

The .NET equivalent of static libraries?

I'm building a tool in managed code (mostly C++/CLI) in two versions, a 'normal user' version and a 'pro' version. The fact that the core code is identical between the two versions has caused me a little trouble as I want to package the resulting tool as a single assembly (DLL) and I don't want to have to include the .cpp files for the...

Looking for .NET Assembly in a different place

Hello Devs, How can I tell my .NET application where to look for a particular assembly which it needs (other than the GAC or the folder where the application runs from)? For example I would like to put an assembly in the user's Temp folder and have my application know that the referenced Assembly is in the temp folder. Thanks ...

Reading from an assembly with embedded resources

I built an assembly containing one js file. I marked the file as Embedded Resource and added it into AssemblyInfo file. I can't refernce the Assembly from a web site. It is in the bin folder but I don't see the reference to it. It seems like not having at least a class inside the assembly I can't reference it. I would include the js f...

How to tell ASP.NET MVC to look for controllers in a library?

Hello, This must be a trivial question to some, but I haven't found any actual information about this. I have an ASP.NET MVC web application. As I like to write reusable code, I'd like to put my Controllers into a separate library assembly and reuse them across multiple web applications. The question is, how can I tell ASP.NET MVC tha...

Is there a way to use IronPython objects and functions (compiled into an assembly) from C# code?

IronPython.net documentation says the MSIL in the assembly isn't CLS-compliant, but is there a workaround? ...