I have created a dotnet core 3.0 shared library for internal usage across projects, I've set up nuget packaging and publishing.
The nupkg file is available in the nuget feed and discoverable:
That v0.1.0-rc-logging0006
version is the correct one. It's the most recent version.
The reference is correctly linked in the solution:
Yet, it appears my package is completely empty.
I've created a test class:
namespace tbn.shared.utility.Logging
{
public class Testing
{
public bool IAmTesting => true;
}
}
Although public, it's not discoverable. Adding the namespace to the using list doesn't work either.
I'm referencing my package from a console app (also dotnet core 3.0), if I add the name Testing
and resolve the reference, that fails. I only get generate class options.
Nuspec
I'm currently using this nuspec definition:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>tbn.shared.utility</id>
<version>$version$</version>
<title>My Title</title>
<authors>Company</authors>
<owners>Company</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>My description</description>
<copyright>Copyright 2019</copyright>
<tags>my tags</tags>
</metadata>
</package>
Question
What could be the reason my package appears to be empty while it isn't and what can I do to resolve this?
I fixed it by adding the following to the nuspec:
<files>
<file src="bin\$configuration$\netcoreapp3.0\tbn.shared.utility.dll" target="lib" >
<file src="bin\$configuration$\netcoreapp3.0\tbn.shared.utility.pdb" target="lib" />
</files>
As a whole that gives:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>tbn.shared.utility</id>
<version>$version$</version>
<title>My Title</title>
<authors>Company</authors>
<owners>Company</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>My description</description>
<copyright>Copyright 2019</copyright>
<tags>my tags</tags>
</metadata>
<files>
<file src="bin\$configuration$\netcoreapp3.0\tbn.shared.utility.dll" target="lib" />
<file src="bin\$configuration$\netcoreapp3.0\tbn.shared.utility.pdb" target="lib" />
</files>
</package>