References from class library are not copied to running project bin folder

Explanation For a sample scenario let’s say we have project X, assembly A, and assembly B. Assembly A references assembly B, so project X includes a reference to both A and B. Also, project X includes code that references assembly A (e.g. A.SomeFunction()). Now, you create a new project Y which references project X. So … Read more

How to debug class library that called from external app?

Yes, you can do this with Visual Studio. You have two options: Configure your project to start the external program Open your DLL project. On the properties for the project, go to the Debug tab. Choose Start external program and give the path of the external program that will call your DLL, along with any … Read more

Java Array sort: Quick way to get a sorted list of indices of an array

Simple solution to create an indexer array: sort the indexer comparing the data values: final Integer[] idx = { 0, 1, 2, 3 }; final float[] data = { 1.7f, -0.3f, 2.1f, 0.5f }; Arrays.sort(idx, new Comparator<Integer>() { @Override public int compare(final Integer o1, final Integer o2) { return Float.compare(data[o1], data[o2]); } });

How to convert a Class Library project to a Web Application project?

I did this by hand today in Visual Studio 2005 because it seemed easier and faster than the above. I just diffed a working web application .csproj file with my class library to determine the relevant differences. Based on that, I made the following changes. Keep in mind that it may be different for other … Read more

Dependency Injection in .NET Core inside a class library

After googling a lot I could not find a comprehensive answer with an example to this question. Here is what should be done to use DI in Class library. In your library: public class TestService : ITestService { private readonly ITestManager _testManager; public TestService(ITestManager testManager) { _testManager = testManager; } } public class TestManager : … Read more

Hata!: SQLSTATE[08004] [1040] Too many connections