Need to update shared C# code using NuGet

curiouswebster
curiouswebster used Ask the Experts™
on
Need to update shared C# code

We have four .NET MVC applications which use a shared C# file located in each of the four solutions at:

AppName.Web.Models.SharedClasses

and I am adding a new C# class.

I have yet to configure the NuGet package so it can be deployed across each solution and currently am using copy/paste to get the same code tested in each solution.

What can you tell me about the NuGet process?

Would I:

1) create the final source code in the shared project?
2) generate a NuGet package for those shared source files?
3) upload it to some server?
4) Using Visual Studio, opened for each target solution, update the NuGet containing the shared files?

Recompile each of four solutions and commit the updated code?

I am a bit unsure of this process.

Thanks.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Glanced up at my screen and thought I had coded the Matrix...  Turns out, I just fell asleep on the keyboard.
Most Valuable Expert 2011
Top Expert 2015
Commented:
Are you hosting actually at NuGet.org, or are you setting up a private NuGet server? I believe NuGet.org open-sourced their server, but you'd have to read through their docs to figure out how to set it up.

Generally the process is to compile your code--preferably on a build server--to ensure that it works, and then package your code using the nuget -pack command. You can optionally package debug symbols as well. You publish the packaged NuGet to your hosting server, and then your consumers can update via Visual Studio (provided they have configured the NuGet server properly within their own Visual Studios).
curiouswebsterSoftware Engineer

Author

Commented:
thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial