Reputation: 576
Forgive what must be a very simple oversight on my part but I simply cannot get this to work as expected.
I am building a .NET Framework 4.6 Class Library that needs to be downloaded by other applications from a private nuget repository. Here is my process:
protected
with public
. I add a new class as well by right-clicking on the project, selecting Add Item, targeting a class and giving it the name TestClass
.C:\Users\jptak\Downloads\nuget.exe pack -Version 1.0.5
Your package was pushed.
): C:\Users\jptak\Downloads\nuget.exe push MyPackage.1.0.5.nupkg MySecretCodeGoesHere -src http://my.nuget.server.goes.here.com
TestClass
is not there. This leads me to believe that the code I am writing is not making it to the NuGet server. Does anyone know what I am missing from this process to make the most recent version of the code get updated on the server?
This process is foreign to me as I am not a .NET developer (I work with PHP mostly).
Here are some more pieces of information about my IDE settings:
Here is the code from my ConsoleApp5:
namespace ConsoleApp5
{
class Program
{
static void Main(string[] args)
{
string testclient = "testclient";
string testpass = "testpass";
string scope = "validate-contract";
string accessToken = "";
string retrievedScope = "";
MyPackage.TestClass test = new MyPackage.TestClass();
}
}
Error: TestClass does not exist in namespace. Did you forget an Assembly Reference?
Here's the TestClass code in MyPackage:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MyPackage
{
public class TestClass
{
public TestClass()
{
}
}
}
The NuGet server I'm using is: https://github.com/Daniel15/simple-nuget-server
EDIT 1
Upon inspecting the .nupkg file, I can confirm that the old code is still there and that the new code has not made it into the .nupkg. This seems to support the idea that the problem is with the packaging process and not on the nuget server. How does one refresh the dll files before each nuget pack
/ nuget push
?
Upvotes: 1
Views: 1341
Reputation: 7444
Bit long for a comment, not exactly an answer but here we go:
So top debugging tips for NuGet packages are:
Download the package manually. A .nupkg
file is just a zip file that can be opened with 7Zip or any other archive tool.
Once inside you can inspect both the .nuspec
file that has been used to pack the package, and inside the lib
folder are the dlls that have been supplied.
A decompiler like DotPeek or ILSpy can be used on the dll to see exactly what is going on inside the dll.
Possible causes of your symptoms could include the NuGet server giving a false success, or your application failing to update the package and still refering to the old one.
Upvotes: 2