I
I
isxaker2015-09-11 19:29:36
.NET
isxaker, 2015-09-11 19:29:36

How to add a link to a class library to a project so that all links from this library are automatically added?

I have a windows service that uses a helper library I wrote - Helpers.dll class library.
This library has a bunch of dll links in its references. One of which, for example System.Web.Mvc.
I add this library Helpers.dll to the windows project of the service, but all references referenced by Helpers.dll are not added to the windows project of the service. How to make it happen automatically?
The fact is that without these references, which are in Helpers.dll, a TypeInitializationException occurs during runtime!
A little more detail on SO

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Makarov, 2015-09-11
@Nipheris

You don't need to add references to every transitive dependency you have.
You only need to reference assemblies that you directly use in the code of the referencing assembly.
In fact, you have a problem with the project build process. There are many ways to solve it, the best option is to work closely with NuGet and take all dependencies from there. Because Since everything is in order with NuGet dependencies, it is very convenient to build your libraries as NuGet packages, then the problems you have indicated simply will not exist in principle.
In general, DNX will be finished soon, its project system has just been transferred to use the package as the main entity for assembly and deployment. This system of projects can be used for non-web projects, it remains only to wait for the release.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question