Library reference vs. NuGet package [closed] - c#

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I have a C# project and I want to add a reference to it. I know how to do it but which one should I use - lib folder in the project or package installation via NuGet? It would be great to have the pros and cons for both with some explanation when the one is better than the other. My current opinion is that I should use NuGet whenever possible because I can see if there is an update for the library directly in VS. But I need more information on the topic...

If the reference is made by you, but managed by, say, a different team, then I'd create a share on the network, or make my own NuGet Server so that you can update your own application, and be independent of how the other team operates.
You can set up a "NuGet Server" very easilly, just create an empty MVC application, and then add "Nuget server" directly from nuget hehe.
A file share on your local network can also serve as a nuget source.
I'm trying to come up with a good, valid reason for NOT wanting to use nuget or any other package managemer source, but I simply cannot. Those old-school "hard links" to references just do not resonate with me, maybe someone else can provide guidance on that.

Related

What is best solution structure for unity component registration in complex project? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I am creating the service where I am using DI container as an entry point.
My solution is getting heavy what forced me to think how to do unity registration in good way.
I have Service with couple of other dlls with logic. As for now, Unity is installed only in Service where all registration is done.
My service needs to refer all dlls which are needed for DI registration and all nugets installed and used by refereed dlls in DI.
It ends up with pretty heavy packages.config in Service which are needed only for DI registration and it is hard to recognize what is used by service itself and what is not.
I am wondering if there is other way, more cleaner way to do registration without huge list of references in main project and do not brake good practice roles at the same time.
I came up with two solutions:
1 - Create separate dll only for UnityConfiguration, I could have there one public static class like: UnityConfiguration.RegisterComponents() which would be called by Service. In that solution I still will have huge list of reference to all the stuff, but it will be at least separated from main service...
2 - Solutions which probably will not be supported by anyone (by me as well): I would have Unity installed in each dll with logic and each dll could have its own static class UnityConfiguration.RegisterComponents() and main service would call all that registration without knowing the types...
Can you please share your way you would go for ? I am really interested in your opinion...

Closed lists for Country Codes, Languages, Currencies, etc [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
What's considered to be a best practice for managing and handling a closed-list of countries, languages, currencies, etc?
We want to be able to consume the data across all of our services
We were thinking of having a NuGet package that will contain Enums, and to consume it wherever needed.
I've seen that some people use tables to manage that data, but since it's constant I don't see a reason for why doing it in that manner. This is data that changes (maybe) once in a decade.
Also, is there already a well known Nuget package containing some of these definitions already? Tried to search for it, but no luck.
Thanks!
If you really want to use packages to do this, then take a look at the results below. However, almost all apps I've seen/worked on generally use services or a database to retrieve this info rather than a nuget or a class containing constants.
Country Codes
This is the best I could find (with over 19,000 downloads): ISO3166
Currency Codes
Two packages with <1000 downloads: Search results for ISO4217
Language Codes
One package with <1000 downloads: Search results for ISO639

How To Use A Custom Library? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I want to use compression of some files but GZipStream can not archive many files in one zip only! So I want to use this
http://icsharpcode.github.io/SharpZipLib/
But I have no idea how to install/use/import custom libraries. What should I do?
Right-click your project and select "Manage NuGet Packages..."
Search for "SharpZipLib".
When it populates the list, install it
The installation process should add the necessary reference[s] to your project's References folder
You might then need to add a "using" for the library to the class where you want to add the code. It's possible, though, that you can just right-click the code and select "Resolve" to have the "using" automatically added for you.
Then look at the library authors' documentation for usage.

Adding a class to a library in c# [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
So I've downloaded a source code from projectcode.com and it's name is BigInteger.cs and it contains codes needed for working with integers beyond UInt64. How can I use it in my projects?And please be noob-friendly in your answers, I've started learning 3 days ago ...
Thanks for your help in advance.
Ideally, you'd want to use BigInteter class from .Net Framework. If you need decimal precision as well, there is no standard BigDecimal available, but a few workarounds can be found here.
If you still want to use that project, you have several options:
Download an assembly file and reference it in your project
Download source code, build it, reference output assembly in your project
Download only the needed file, provided it is self-contained, add it to your project and use it
In any case make sure to follow the license terms.

How can I effectively manage class libraries that reference each other? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I am going to be creating a web application for internal company use. I created one "General.dll" class library that contains abstract classes such as Person, EmailAddress, etc. And then I created an "EmployeeManagement.dll" which includes classes such as Employee : Person, EmployeeEmailAddress : EmailAddress, etc.
My EmployeeManagement.dll references and relies on General.dll.
Then my web application will reference EmployeeManagement.dll.
How can I effectively keep track of cascading changes? For example, if I make a change to General.dll, I will need to recompile that class library into a new General.dll, and then remember to reference the new General.dll in every other class library that uses it. Then those libraries will need to be recompiled and I have to remember to update the references in the web application to those as well...Seems like there must be a tool or more efficient way to handle this that I just don't know of. Any tips?
For a start, if you add all of your projects to the same solution in Visual Studio then they will automatically be rebuilt as appropriate based on dependencies when you make a change.
Also, during development you probably don't want to add a reference to a particular version of an assembly (this is the default when choosing 'Add reference'). In this way, any changes to your General.dll will automatically cascade to any other project that references it on the next build.
Edit after update from OP
You are quite free to reuse projects in different solutions. So you can have exactly one codebase for General.dll and include that project in any solution that needs it. In that case you of course need to be careful when making changes to General.dll to avoid potentially breaking any project that includes it (a continuous integration utility can help here).

Categories

Resources