1
votes

I'm making a nuget package for my own internal use called BlobUtils. However, when I install it, my code doesn't recognize the "using" statement and it doesn't show up in the references list.

I opened up the package in NuGet Package Explorer, and it seems to look okay. I've attached a screenshot below.

I've also included a screenshot of it not working in my project. (NOTE: the using statement says "BlobUtil" because I was messing around with it, but "BlobUtils" also doesn't work.)

Thoughts?

enter image description here

enter image description here

1
So did you install the package after you created it? I can't tell from your screenshot, but it seems like it isn't installed.Michael Tracy
@MichaelTracy Yep, it's installed.Slothario
Then there should be a packages folder in the solution with the DLL in it - you have to add that to your references.Michael Tracy
@MichaelTracy Thanks for the tip -- it sent me in the right direction. The nuget package didn't have the right DLLs, because the "nuget pack" command didn't seem to be working. I had to create a directive in my nupack file instructing how to copy the files. Thanks for your help! It's working now.Slothario

1 Answers

0
votes

EDIT: see imps comment below to do things better than I did.

Thanks to Michael Tracy's tip, I noticed the DLLs and the overall structure of my nupkg file was all wonky. I was getting warning messages stating "Issue: Assembly outside lib folder." What it really meant was nothing was going to the lib folder at all. I added the following lines to my nuspec file:

  <files>
      <file src="BlobUtils\bin\Debug\*.dll" target="lib" />
      <file src="BlobUtils\bin\Debug\*.pdb" target="lib" />
  </files>

That forces the intended behavior of nupack.