class-library

How to write a simple Expression-like class in .NET 2.0?

I'm currently working in .NET 2.0 Visual Basic. The current project is an Active Directory Wrapper class library within which I have a Searcher(Of T) generic class that I wish to use to search the underlying directory for objects. In this Searcher(Of T) class I have the following methods: Private Function GetResults() As CustomSet(Of T...

Class Library in C@

I solved my class library problem - my constructor that i created was done with a capital Public instead of public. Punctuation makes a world of difference in Visual Studio. Therefore i can now make, build, and implement within a winform application. Thank you for helping me see the light. But now comes the real problem. When i use ...

How do I make WPF windows available in a class library?

I'm creating a class library that makes available some XAML windows (in theory). To create the XAML, I right clicked on the project and then clicked Add->New Item, and then specified Window (WPF). I then created my XAML, which I had already prototyped in a stand alone application. However, when I go to build my project, I get the followi...

Expose a class library as a "WCF Data Service"

Is it possible to expose a .NET (class) library through a WCF Data Service ? Makes this scenario sense ? Or is the usage of pure WCF the best and only way in this case ? Background: I have several (old) C# classlibraries (which encapsulate the access to different datasources), which I want to use with Ajax and Silverlight. I cannot and ...

Can you access an object through two layers of assemblies?

I have a public class, MainObject that is in a class library (dll), for this example we will call it BaseLibrary. I have a higher level class library that references the BaseLibrary to gain access to it's members. We will call this one DeviceLibrary. I then have a Windows Forms Project, DeviceControl, in which I have added a reference ...

How to point out to a method in project to be executed inside a class library component

In the past I had quite some reusable code in my project which I would like to put inside a custom class library project so other projects can reuse it. There is only just one piece of code which needs configuration in code which is project dependent. How can I inject a method to be executed in my project inside a method of the class li...

Custom Profile Provider with class library

I have a class library (lets call it a) which i've created a custom profile provider in. I reference this library in another class library (lets call this b) which is part of a solution along with a web application. Now how do i reference the custom profile provider in class library b. I've been following this article http://leedumond.c...

Why can't I access my class through COM?

I have a class library that I have written in C#.net. I want to register it with COM on my 64 bit windows machine so that I can create instances of it using CreateObject() in scripts (javascript, vbscript, whatever). So I created a setup project. I set the Target Platform of the setup project to x64. The class library project's Target pl...

Having trouble registering assembly for COM

I have created a simple class library project in visual studio 2008 that has one class as shown below. I am trying to get this class to register for COM interop so that I can use in via unmanaged scripts like vbscript or jscript. In my project build properties I have checked the box that says "Register for COM Interop". In the Assembly...

Same class comes within different web services

I have 3 different web services work with same class library. These three web services return same class type object. But on the client side, I'm getting 3 different object type even they are same. I can't treat them like one class type. I think i will add a method which can take object and sets properties with object's props. Is the...

Copying of depended-upon dlls in Visual Studio

In my solution, I have a Windows Service called MuskOx. MuskOx has a project reference to a class library called MuskOx.Errands. MuskOx.Errands has project references to class libraries called Kctc.BusinessLayer and Kctc.NHiberate. When I build MuskOx, its output folder gets Kctc.BusinessLayer.dll but not Kctc.NHibernate.dll. This is...

Passing arguments when loading custom CodeIgniter library

I'm trying to implement a class I've written as CodeIgniter library. Somehow I can't get CI's load() method to pass multiple arguments to the class's constructor function. My class is designed to get 3 arguments, 2 arrays and one optional string. The constructor looks somewhat like this: public function __construct($array, $array,$st...

How should I store my custom classes?

I've gotten to the point where I have made a few classes that I have found to be rather useful for a variety of different projects, they're either extensions of the already existing .Net ones or something entirely new. Although I may not use them for EVERY project I would most certainly use them again at some point, my questions is what...

How to create a custom .NET base class library (BCL) aka mscorlib replacement?

Does anybody know how to make a custom BCL work with the stock CLR? How to discover existing the most essential ties between CLR and BCL and reuse them? Here is what I have so far: http://lightnet.codeplex.com ...

.net 2010 calling DoEvents (yes I want to) from inside a custom control library

I have a custom control's library. Now there's a control which looks like a panel, and when it opens up I want to animate its vertical growing like this: For h As Single = 0 To finalHeight Step 0.5 Me.Height = CInt(h) ' HERE I WANT TO CALL DoEvents' Next Me.Height = finalHeight If I don't call DoEvents in the loop then the a...

execute code on first call to the dll

I a c# class library. Is there anyway that a method can be run on first call and only on the first call to the dll? ie. similar to in a web application - global.asax - Application_Start method. ...

C# Class Library: StreamWriter writing to system32 folder

I have a class library which is deployed on an ISP server to be consumed by an ASP.NET web service. I'd like to keep track of any errors and in this case the windows event log is inaccessible to me. So I thought I'd write to a txt file using the StreamWriter class. Problem is if I don't give an absolute path and just a file name it tries...

.NET including class library database (and other resources) with windows app deployment

I have a class library that attaches itself a tiny SQL Server database that resides in its Data Directory. When i'm using this class library with another windows application i see that once i compile my code, the database files get copied to the bin folder of my windows app project. However when i publish the windows app,install, and run...

Visual Studio: how to debug a library with an external executable?

I am developing a class library. The library is to be used by another program, an .exe with no source code. The library file location is passed as a parameter to this exe, for example by running: prog.exe lib.dll I would like to debug the library using this .exe (using debug tools such as breakpoints, etc.) How do I use Visual C# to do ...

Can I use a Windows -> Class Library inside a WP7 application?

I'm creating a library application that will act as a wrapper for an exposed API. This library ideally should work on any desktop application, but truth be told I'm intending to use this on the WP7 once I'm done creating the library. Would this work? ...