Need to update shared C# code using NuGet

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.
newbiewebSr. Software EngineerAsked:
Who is Participating?
 
käµfm³d 👽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).
0
 
newbiewebSr. Software EngineerAuthor Commented:
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.