I created a .net core class library and a .net core web application from Visual Studio using default project templates. And I created a nuget package for this class library then I copied it to my local nuget folder.
When I try to add this nuget reference to my web application I am getting a reference error and the output is like this:
Package Manager Output
Installing NuGet package Solid.Common.Log.1.0.0.1.
Successfully installed 'Solid.Common.Log 1.0.0.1' to Solid.Disaster.Web
========== Finished ==========
PATH=.\node_modules\.bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External;%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\git
C:\Program Files\dotnet\dotnet.exe restore "D:\Projects\Playground\Solid.Disaster.Web\.vs\restore.dg"
log : Restoring packages for D:\Projects\Playground\Solid.Disaster.Web\src\Solid.Disaster.Web\project.json...
info : CACHE https://api.nuget.org/v3-flatcontainer/microsoft.netcore.dotnethostresolver/index.json
info : CACHE https://api.nuget.org/v3-flatcontainer/microsoft.netcore.dotnethost/index.json
warn : The folder 'D:\Projects\MyNuget\Solid.Common.Log\netstandard1.5' contains an invalid version.
info : GET https://api.nuget.org/v3-flatcontainer/solid.common.log/index.json
info : NotFound https://api.nuget.org/v3-flatcontainer/solid.common.log/index.json 661ms
error: Unable to resolve 'Solid.Common.Log (>= 1.0.0.1)' for '.NETCoreApp,Version=v1.0'.
log : Restoring packages for tool 'Microsoft.AspNetCore.Server.IISIntegration.Tools' in D:\Projects\Playground\Solid.Disaster.Web\src\Solid.Disaster.Web\project.json...
info : Committing restore...
log : Writing lock file to disk. Path: D:\Projects\Playground\Solid.Disaster.Web\src\Solid.Disaster.Web\project.lock.json
log : D:\Projects\Playground\Solid.Disaster.Web\src\Solid.Disaster.Web\Solid.Disaster.Web.xproj
log : Restore failed in 1382ms.
Errors in D:\Projects\Playground\Solid.Disaster.Web\src\Solid.Disaster.Web\Solid.Disaster.Web.xproj
Unable to resolve 'Solid.Common.Log (>= 1.0.0.1)' for '.NETCoreApp,Version=v1.0'.
NuGet Config files used:
C:\Users\SolidWrist\AppData\Roaming\NuGet\NuGet.Config
C:\ProgramData\nuget\Config\Microsoft.VisualStudio.Offline.config
Feeds used:
https://api.nuget.org/v3/index.json
D:\Projects\MyNuget
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
Here is my environment info:
.NET Command Line Tools (1.0.0-preview1-002702)
Product Information:
Version: 1.0.0-preview1-002702
Commit Sha: 6cde21225eRuntime Environment:
OS Name: Windows
OS Version: 6.3.9600
OS Platform: Windows
RID: win81-x64Nuget Package Manager 3.4.4
This is the class library's project.json:
{
"version": "1.0.0.1",
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027"
},
"frameworks": {
"netstandard1.5": {
"imports": "dnxcore50"
}
},
"scripts": {
"postcompile": [
"dotnet pack --no-build --configuration %compile:Configuration%"
]
}
}
Web Application's project.json:
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-rc2-3002702",
"type": "platform"
},
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
"Solid.Common.Log": "1.0.0.1"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"dnxcore50",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"gcServer": true
},
"publishOptions": {
"include": [
"wwwroot",
"web.config"
]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
NuGet.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<activePackageSource>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</activePackageSource>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
<add key="LocalFeed" value="D:\Projects\MyNuget" />
</packageSources>
<disabledPackageSources>
<add key="Microsoft and .NET" value="true" />
</disabledPackageSources>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<bindingRedirects>
<add key="skip" value="False" />
</bindingRedirects>
</configuration>

I've also asked the same question on stackoverflow.
What might be the reason of this error?
Thanks.
@pranavkm
For the folder structure you have to work, the sha file has to sit next to the nupkg. Instead of manually creating the directory, use nuget.exe add <nupkg> -Source D:\Projects\MyNuget once you have deleted things under that directory. Try restoring after.
@pranavkm Ok, I ve run it and it is working now.
Thank you so much!

I realized that I've tried this yesterday at work but when I did that Solid.Common.Log was removed from Manage Packages for Solution Window, even if I refreshed the feed a couple of times.
This time, same thing happened but I didn't give up.
I opened up Nuget Package Manager > Source settings and clicked Update for my local feed then refreshed the feed... and again this package didn't appear there.
As a last step: I moved up my Local Feed source as the first item in the source list, then clicked Update again and it worked!

Most helpful comment
For the folder structure you have to work, the sha file has to sit next to the nupkg. Instead of manually creating the directory, use
nuget.exe add <nupkg> -Source D:\Projects\MyNugetonce you have deleted things under that directory. Try restoring after.