How to add third-party libraries without repeating each project in vs2019 - visual-studio-2019

I build many projects in a solution. One of them use third-party.If another project use this project, it need set the same third-party too. It's too trouble. I want to know it is there any method to solve this problem?

Related

WebStorm solution with several Dart projects

I develop Dart with WebStorm. I have a server-project, a client-project and some shared code.
Is it possible to create a project solution, containing several Dart projects (like you can do in VisualStudio)? Or is it common to develop each project in it's own WebStorm window?
You can configure as many content roots as you want in one WebStorm project, see Settings (Preferences) | Directories.
See also https://www.jetbrains.com/help/webstorm/directories.html and https://www.jetbrains.com/help/webstorm/content-root.html
You can put the project directories together in a directory and then open that directory instead.
There are also ways with project root configurations to do that with projects that are not in the same directory but I did't bother to try to understand how this exactly work.
I moved away from this setup and use different windows for different projects a while ago because I don't want to maintain project configurations. I have many Dart projects that are reusable packages that I use in many other projects.
Using one window for one Dart package seems to be the easiest setup.
I configured keyboard shortcuts (there are probably defaults anyway) for easier switching between WebStorm windows.

How to manage 3rd-party library in iOS project if its source code needs to be modified in order to be used?

We need to use some 3rd-party libraries in our iOS app project (which is an Xcode project). The 3rd-party libraries are either managed by Cocoapods or directly added in the project by importing source code files.
Sometimes we need to modify a library's source code in order to actually use it appropriately in our project. It's easy to make the modification since we have all the source code at our hand, but how can we maintain the modification when some time in the future we upgrade the version of the 3rd-party library? Is there any tools or best practice out there that can help with this? And after the upgrade of the 3rd-party library, it will be good if we could differentiate in the code history about which part is done by library upgrade and which part is done by our modification.
That depends entirely on what your change is...
The best option is to not change the external code. Instead, subclass the part you need to change and use only public API so you should find out early when updating if the subclass needs to change. Unit tests also help.
If you can't subclass then you should fork the external code, then you have to manually merge updates on top of your change when you want them. This is obviously significantly more effort both in terms of importing and managing the code.

How do I convert a specific controller to a package to include in other projects?

VS2013, MVC5, VB
I am nearing the completion of a small project to manage the roles tables in a standard MVC5 application. The code is pretty much encapsulated. What are my options for using this 'package' in other projects?
Can I compile it into something? I know this type of action is possible, I'm just not familiar with the options available to me or the steps to do this. Links to sites that have tutorials are fine. Is creating a Nu Get package the only way to go, or is that even in the ballpark of what I'm asking. I say Nu Get, but I don't mean for public consumption, only for my consumption.
Will the finished 'whatever' include it's controller class, view models and views? Will I be able to easily manage updates? etc.
Creating a Nuget package is one way. I have created a local repository of common utilities for this purpose. But I usually use it just for DLLs. I use Nuget Package Explorer for its ease of use since its just me using the packages most of the time. Not sure its possible to place the files in specific directories.
Files in the content folder are copied to the root of your application when the package is installed. - Nuget
The alternative is to create an item template. I used to use this method for class files I want in my code but I can't see why you couldn't do it for the rest. Works well and isn't too hard to set up. There are dozens if not 100s of tutorials on the subject. Here is one on code project.

What exacly is "buidling" from source and how does it work

So I really cant understand how this work but late me explain. First, just in case you need it, I am running Ubuntu 12.04 64-bit on a laptop.
As a building tool am using CMake. I want to load in to my project OpenCV, MRPT (http://www.mrpt.org/) and libfreenect. All of them have a "source code". What I don't understand is when they say "build from source". How to I make a project with all of them?
Do I need to build each one individually and with some way but then in my project OR do I down load the source code and build them all together at ones? As you can see I'm really confused what I have to do... do I run the CMakeList.txt from each source code and the run one CMakeList.txt that has all the other CMakeList.txt?
In fewer world, if I want to build from source, two or more libraries, how do I do that?
I would like a general answer (how this "build from source" works) and an answer specifically on the the ones I mentioned (CMake, OpenCV, MRPT, libfreenect). I hope I made clear what I don't really understand.
It depends of the 'master' project. In general in the c/c++ universe your project must know how to invoke the build process of each subproject/library OR your project needs to know how to include&link the results after building each external project yourself.
You can also mix the two approaches if needed but I think it cleaner to try to use one if possible.
In the first case if all the subprojects offer cmake building files (CMakeLists.txt) you may try to add_subdirectory() each and see if there are any conflicts. For example google test can be easily included this way and it gives your project some global variables that easy linking later.
Alternatively or if the above approach gives problems or the sub project doesn't provide CMakeLists.txt you can use ExternalProject_add(). It takes more work and you have to handle includes/linking configurations with your project manually but it makes the subproject more independent. For example if there are conflicting targets with your project or the subproject doesn't provide CMakeLists.txt.
The last approach involves building and installing the sub projects separately, using configuration variables in your project to point the includes/libraries paths of the sub project. Check CMake:How To Find Libraries for details.

build .net class library into multiple files

i have a class library project that i dont want to split into more than one project, however i would like to compile and build it to multiple dll files instead of one big file. how could i do this?
This is called a MultiModule Assembly. This involves writing a custom Makefile and performing the build using nmake.
The Multi-Module Assemblies article on eTutorials is very clear and straightforward with instructions on how to accomplish this.
Write your own compiler? I don't think this is possible...
You could have a post-build step to copy and rename your dll so you would have two different dlls, but then they'd just be the same...
How would you specify which files got build into which dll?
That is kind of the whole point of having separate projects.
You can have the projects reference each other so they can use the code from the other dlls.

Resources