简体   繁体   中英

NuGet package fails to install

We've got some internal reusable libraries that we're currently juggling around at my place of work. I thought it would be nice to chuck some of these on an internal NuGet server. Unfortunately this is proving harder than planned.

The package I'm trialing this with is a simple JavaScript library. I created a folder called Package containing a folder called Scripts, which I put the JS files in. I then opened a command prompt at the Package folder and ran NuGet spec which ran successfully. Then I edited the .nuspec file and ran NuGet pack , generating a .nupkg file.

Great, works perfectly. I added the folder containing the .nupkg file as a NuGet source. I can now run (from the commandline) NuGet install and it works fine!

I have a test project all set up and ready to go for this library, the only thing left is to install the package. So in Visual Studio I go into Manage NuGet Packages and select my source. I select my library and hit install and a dialog pops up showing progress. It says "successfully installed" and all that and then exits. However in Manage NuGet Packages the install button HAS NOT changed to an uninstall button, the package does not show up under Installed Packages and none of the files from the package have been added to my project or exist on the disk. Clicking on the install button subsequent times does absolutely nothing.

Not really sure what I'm doing wrong, would very much appreciate some help.

Thanks,

YM

EDIT: I should mention that I can install other packages just fine, and I have tried installing this package in a different solution with the same result.

Okay, the issue was that the Scripts folder should not go directly in the root directory of the package, but instead must sit under a Content folder. That took me a long time to work out, hopefully it helps someone else.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM