problem about class-library-Collection of common programming errors

Konstantin Tarkus
c# .net clr class-library mscorlib
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
Bill the Lizard
frameworks class-library
I hear the whole day the terms class library, base class library, Framework, … What highlights a framework and what a base class library?
Andrii Kalytiiuk
c# app-config class-library
Problem is that my settings from “app.config” is not being gotten in class library project.Can “app.config” be used in applications only and not in class libraries?
Charan
c#-4.0 plugins dynamics-crm-2011 class-library .net-assembly
In Microsoft Dynamics CRM 2011, I wrote one plug-in in C# for Account entity to do some operations on fields when Account record is created. In C# code I created my own custom assembly called My.Custom.Assembly.dll. Which contains some generic methods those I can use often in my plug-in. And I using this My.Custom.Assembly.dll and also added in reference in my project. Project builds successfully and plug-in registration also. The problem I faced when I was creating a Account record. Its throwi
Chris
.net visual-studio-2010 class-library mixed-mode
I have a common problem with a unique twist. I am running VS2010 and using a cluster of 3rd party DLLs that must have been compiled in a previous framework. Of course I get the following error: Mixed mode assembly is built against version ‘v2.0.50727’ of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.I’ve solved the issue before with these DLLs in a Windows Forms Application by adding the following to an app.config file:<configuration> <
vivek jain
c# c++ visual-c++ class-library
I am working on a project. In that C++ code is referencing to a Class Library which is written in C#. I want to pass Object of C++ Classes to C# Class library. So Is this possible, If yes please let me know how ?? otherwise I will have to pass around 100 arguments to C# Class Library.Regards, Vivek
Beatles1692
c# app-config class-library comvisible
I’m working on this ComVisible class library that uses a third party component.This component needs some settings to be added to the config file.Since the application that uses my dll is a VB 6 application I don’t know where should I put the config file? is there anyway that we can load a config file at runtime?
starblue
c# assemblies versioning class-library stylecop
So here’s the problem. I’m writing some StyleCop plug-in assemblies for use at the company I work for. As such, these assemblies need to reference Microsoft.StyleCop.CSharp.dll for example, which is strongly named.The problem comes in that if I build this and pass it along to the developers in my group, they must have the same version of the StyleCop dll (currently 4.3.3.0) or it fails to load.What is the best way to make my add-on rules DLL more independent? Should I just install my 4.3.3.0
starblue
c# assemblies encapsulation class-library
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 to DeviceLibrary. If I need to use a MainObject object, how do I do it? I know I can just add a second reference in the DeviceControl project to the BaseLibrary but
Wim ten Brink
.net class-library
Present Value is the value on a given date of a future payment or series of future payments, discounted to reflect the time value of money and other factors such as investment risk. And yes, I know it’s formula so don’t need that.But I am wondering if this method is already predefined within the .NET libraries. I can’t find it. (And I guess .NET doesn’t contain this function so I will just have to use my own function instead.)I have no use for any nice third-party components or samples written
Agzam
c# web-config connection-string app-config class-library
I have a web project (mvc) and data access layer in a separated class library project. I need to access to a connection string in app.config which sits in that library project. ConfigurationManager.ConnectionStrings[0].ConnectionString pulls something strange. I don’t have this kind of settings neither in the library’s config nor in the web project’s config files.the App.config looks like that:<?xml version=”1.0″ encoding=”utf-8″ ?><configuration><connectionStrings><add name
Code-Guru
eclipse android class-library
I have created an Android project and added an external JAR (hessian-4.0.1.jar) to my project. I then add the JAR to the buildpath and check it of in Order and Export.Order and Export is ignored it seems, and all classes from the external JAR is missing in runtime.Is there a trick to properly include the needed classes from an external JAR when building an Android application using the Eclipse Plug-In. I do not want to use ant of Maven.
Darryl
c# licensing class-library license-key
I’m developing a .Net class library (a data provider) and I’m starting to think about how I would handle licensing the library to prospective purchasers. By licensing, I mean the mechanics of trying to prevent my library from being used by those who haven’t purchased it, not the software license (i.e., Apache, Gnu, etc).I’ve never dealt with licensing, and in the past, I’ve always developed apps, not libraries. I don’t want to make things difficult for my customers; know it is not possible to
Ben McCormack
vb.net animation class-library doevents
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.5Me.Height = CInt(h)’ HERE I WANT TO CALL DoEvents’ Next Me.Height = finalHeight If I don’t call DoEvents in the loop then the animation is not shown, I only get the final height without a visual feedback along the way.I can call DoEvents from inside my main WinForm project, but can’t inside a library.H
Casey Wilkins
.net events exception class-library
Something occurs that is more or less expected with normal use of a .NET library you are writing. You need to notify the user/UI/caller that this event has occurred, even though it is expected and not exceptional. Do you:A) Throw an exception, let the UI catch it and deal with it.B) Raise some type of event that the UI can listen for.C) Do something elseWhich of the above do you do? If both, what are your guidelines for when to throw an exception vs. raise an event? What are the pros and
Lankymart
c# dll exe class-library typeloadexception
I’ve got a really strange error occurring in my solution one of my projects which is a class library is causing a project it is referenced in to throw a TypeLoadException. I’ve looked through various answers on SO and the closest to my issue is;TypeLoadException was unhandled in C# [closed]This answer led me to question if this was my issue, doing some digging in the debug folders I found that my project that was referencing my class library is generating a DLL and EXE with the same name, could
Ricks
c# logging exception-handling class-library
I am trying to work out an error logging solution for an enterprise-level class library. Some of the requirements:It will be used by multiple end-point applications (hence why it should be handled in the classlibs) It should sink its data into a SQL Server database for easy storage. This also goes into the third one: It should be able to support a custom web application reading its data.There’s one more requirement, which is a ‘very nice to have’. That is, it’s not critical, but if it’s not f
CharithJ
c# .net class-library
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 for this might be configuring and instantiating a logger singleton, unhandled exception handler, etc.
Greg Gra
c# .net exception console-application class-library
I try to rethrow an exception, but it’s not working. I get ‘Exception was unhandled’ error in visual studio. public KeyValueConfigurationCollection getMyAppSetting() {Configuration config;ConfigurationFileMap configFile;try{configFile = new ConfigurationFileMap(ConfigurationManager.OpenMachineConfiguration().FilePath);config = ConfigurationManager.OpenMappedMachineConfiguration(configFile);AppSettingsSection MyAppSettingSection = (AppSettingsSection)config.GetSection(“xxx/appSettings”);MyAppSet
cagin
c# visual-studio-2010 class-library
I have a class lib and I refferenced it to another windows project. I added its namespace to my Form.cs (using SaglikNetClassLib;). they are seem unknown when I want to access to classes. I can see their properties and methods. But the complier says “Error 7 The type or namespace name ‘SaglikNetClassLib’ could not be found (are you missing a using directive or an assembly reference?), Do you have any suggestion?KR,Çagin
Web site is in building