Questions tagged [class-library]

A collection of classes combined into a unit maybe distributed by a third party. It may have dependencies to further libraries.

A collection of classes combined into a unit maybe distributed by a third party. It may have dependencies to further libraries.

Frameworks usually use this quite a lot.

1024 questions
25
votes
2 answers

Cannot find Bitmap Class in Class Library (.NET Standard)

I want to make a Class Library (.NET Standard) and I'm using System.Drawing, but I get the error: CS0246 C# The type or namespace name 'Bitmap' could not be found (are you missing a using directive or an assembly reference?) I'm using .NET…
IIRawCodeII
  • 375
  • 1
  • 3
  • 9
25
votes
1 answer

Class library does not recognize CommandManager class

I'm developing WPF applications and I want to reuse my classes that are the same in all those applications so I can add them as a reference. In my case I have a class for my Commands: public class RelayCommand : ICommand { #region Fields …
koala
  • 1,544
  • 1
  • 20
  • 33
23
votes
1 answer

Using ASP.Net MVC Data Annotation outside of MVC

i was wondering if there is a way to use ASP.Net's Data annotation without the MVC site. My example is that i have a class that once created needs to be validated, or will throw an error. I like the data annotations method, instead of a bunch of if…
Doug
  • 6,460
  • 5
  • 59
  • 83
23
votes
4 answers

WCF Service Library vs Class Library project types

What does a WCF Service Library do that a regular class library doesn't? Edit: I posted my own answer. Am I missing anything? Are they fundamentally both just class libraries with a few template classes added?
kenwarner
  • 28,650
  • 28
  • 130
  • 173
22
votes
6 answers

Read from App.config in a Class Library project

I am developing a simple class library project, which will give me a dll. I wanted a particular value to be read from a config file. So I have added an App.config file to my project.
Yasser Shaikh
  • 46,934
  • 46
  • 204
  • 281
19
votes
4 answers

Is there an equivalent of Application_Start for a class library in c#

I would like to execute certain code in a class library when it is instantiated from another assembly. Is there an entry point or bootstrap for a class library? I thought that a static method Main would do the trick but I was wrong. Applications…
Diego
  • 998
  • 1
  • 11
  • 20
18
votes
7 answers

How can I make a .NET class library read its own configuration file?

I have a .NET class library that provides a set of helper functions that are used by several Web Services. This class library must store a single setting, specifically, a connection string, which need not be seen by the Web Services themselves,…
isekaijin
  • 19,076
  • 18
  • 85
  • 153
18
votes
3 answers

Cannot find ConfigurationManager in class library

So, I have a class library that I know will be used by websites and I need to access the config settings. I added a reference to System.Configuration, but I cannot find ConfigurationManager in the class library. A couple of things, one when I…
ScubaSteve
  • 7,724
  • 8
  • 52
  • 65
17
votes
7 answers

When is it the right time to use C# class library (.dll)?

I'm a programmer who has never really used .dll files. Of cause, when I need 3rd party software, such as a graphics library, a library to help me create graphs etc. I do add the references/ddl files to my program and use them in my code. Also, it…
CasperT
  • 3,425
  • 11
  • 41
  • 56
17
votes
1 answer

path to file in class library

I have a class libary project (NotificationTemplate) which return content of file: public static class Template { public static string NotificatioEmail { get { return File.ReadAllText("Templates\\NotificatioEmail.cshtml"); } …
user348173
  • 8,818
  • 18
  • 66
  • 102
16
votes
11 answers

What is the difference between a class library and a framework

I hear the whole day the terms class library, base class library, Framework, ... What highlights a framework and what a base class library?
Peter Gfader
  • 7,673
  • 8
  • 55
  • 56
16
votes
4 answers

How to debug a class library in Visual Studio

I am working on a class library (DLL) project in Visual Studio 2008; programming in C#. In order to test my DLL I just created a second project that is a console application and in that project I can reference the first and run tests. Is there a…
PICyourBrain
  • 9,976
  • 26
  • 91
  • 136
16
votes
6 answers

Visual Studio Performance Profiling - Class library symbols could not be found

I'm trying to Instrument an ASP.NET web-application with Visual Studio 2012, .NET 4. The solution contains a web-application and a class library. The problem is I can't see step into the class library, I get a message stating: Matching symbols could…
kipusoep
  • 2,174
  • 6
  • 24
  • 34
16
votes
3 answers

Cannot debug a unit testing project in Visual Studio 2012

I couldn't find a post similar to this, so I hope this isn't a duplicate. I have a c# class library that I'm trying to run unit tests on in Visual Studio 2012. I've added a new Unit Test Project to my solution, and added my main project as a…
Matt
  • 161
  • 1
  • 1
  • 3
15
votes
3 answers

Why am I getting the "LoaderLock was detected" warning when debugging?

I'm developing an add-on for AutoCAD 2009. The project output is a class library. When I attempt to debug and load the class library, I get this "LoaderLock was detected message." I've been writing these add-ons for awhile and this is the first…
DenaliHardtail
  • 27,362
  • 56
  • 154
  • 233
1
2
3
68 69