'Visual Studio 2019 create NuGet package that includes NetStandard and updates web.config

Recently, I created a NuGet package in Visual Studio 2019 by following the steps here to create the package using the "Pack" command. The problem is when I tried to use the models from the Class Library in the package, I kept getting errors saying that I needed to add a reference to NetStandard (see Stackoverflow question here). I eventually determined that I had to install NetStandard from NuGet and then manually add the assembly to the web.config file in the application in which I was trying to use the NuGet package I created.

My question is, what do I need to do when creating the NuGet package to get it to add NetStandard (it automatically adds the other dependencies like Newtonsoft.Json), and have it update the web.config file so I do not have to tell my users they must manually update their web.config?

I assume there has to be a way to do this because when I install other NuGet packages, my web.config is often updated and all needed dependencies are added. I have been scouring the internet looking for answers, but I am not even sure how to search for what I need. (We all know typing in the correct search criteria is extremely important.)

I am hoping this all makes sense to someone who knows. I will continue trying to find answers online, but if you can help, please do so.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source