I want to create a nuget package of my .net core class library.
- I copied the nuget.exe file to the root folder of my Solution
Run nuget spec and Solution.nuspec file created. I modified it as below:
<?xml version="1.0"?> <package > <metadata> <id>Solution</id> <version>1.0.0</version> <authors>cc Team</authors> <owners>cc</owners> <licenseUrl></licenseUrl> <projectUrl></projectUrl> <iconUrl></iconUrl> <requireLicenseAcceptance>false</requireLicenseAcceptance> <description></description> <releaseNotes></releaseNotes> <copyright>Copyright 2017</copyright> <tags>c# .net</tags> <dependencies> <dependency id="NETStandard.Library" version="1.6.1" /> </dependencies> <references> <reference file="Solution.dll" /> </references> </metadata> <files> <file src="Solution.dll" target="lib\netstandard1.6\Solution.dll"/>
file's node src value outpupath of my solution. (bin\Release\netstandard1.6\Solution.dll)
- Run nuget pack Solution.nuspec and Solution.nupkg file created.
- I put it to my package source.
- Create a new .net core class library and select my Solution nuget package from local package source. It added to my project. There is no error or warning. But When I try to access a class from my Solution nuget package, it couldn't be found.I dowloaded 'Nuget Package Explorer' and opened my Solution.nupkg. Icould see Solution.dll and Solution.pdb file under lib --> netstandart1.6.
Then I searched about the error and found this :
"scripts": {
"postcompile": [
"dotnet pack --no-build --configuration %compile:Configuration%"
]
}
After compile my Solution project it creates Solution.1.0.0-0.nupkg file and Solution.1.0.0-0.symbols. I put it to my local package source but these packages are not listed in the 'Nuget Package Manager'.
Do you have any idea?