Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nuget pack of xproj is defaulting to invalid target path #3060

Closed
CheloXL opened this issue Jun 29, 2016 · 11 comments
Closed

nuget pack of xproj is defaulting to invalid target path #3060

CheloXL opened this issue Jun 29, 2016 · 11 comments

Comments

@CheloXL
Copy link

CheloXL commented Jun 29, 2016

Using nuget.exe 3.5 beta 2.
On a simple .NETCore I run nuget spec, build the project, nuget pack, and I get
Attempting to build package from 'Disposable.xproj'. MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'. Unable to find '.\bin\Disposable\bin\Debug\'. Make sure the project has been built.

The path where the binaries are is 'bin\Release\netstandard1.6'. Not sure why is picking "Debug", as the project is on release build.

@rrelyea
Copy link
Contributor

rrelyea commented Jun 29, 2016

Unsure if this is inconsistent with a csproj?

@rrelyea rrelyea changed the title nuget pack unable to find directory nuget pack of xproj is defaulting to debug - right behavior? Jun 29, 2016
@CheloXL
Copy link
Author

CheloXL commented Jun 29, 2016

@rrelyea Just a comment (as you changed the title): It's not only that it's defaulting to debug, but the folder where nuget tries to find the binaries is completely wrong.
Even building in debug mode, the correct path (to the debug .dlls) is bin\Debug\netstandard1.6

@jainaashish jainaashish self-assigned this Jun 30, 2016
@jainaashish
Copy link
Contributor

jainaashish commented Jul 5, 2016

@CheloXL To workaround you can always use .nuspec file instead of .xproj and that will just work fine. Mean time we'll analyze it.

@CheloXL
Copy link
Author

CheloXL commented Jul 5, 2016

@jainaashish nuget pack disposable.nuspec gives me "Value cannot be null or an empty string. Parameter name: value"

@jainaashish
Copy link
Contributor

You need to update the .nuspec file and give values to metadata like id, version, title, etc...

@CheloXL
Copy link
Author

CheloXL commented Jul 5, 2016

Ah, ok. A nicer/clearer error message would be also great...

@jainaashish
Copy link
Contributor

yeah, it's in pipeline to update error/ warning messages. And about picking 'Debug' then default configuration with MsBuild is Debug so it picks that. You can also change it to Release by passing -Properties Configuration=Release with Pack command and all these properties attributes are then passed into Msbuild.

You can also use project.json to create nupkg just like .nuspec... you would just need to add Authors n Description details in project.json

So there is no further action required here as of now. Let us know if you face any issue with .nuspec or project.json file.

@CheloXL
Copy link
Author

CheloXL commented Jul 5, 2016

Excellent. Using project.json everything seems to work fine. Thanks!

@jainaashish jainaashish changed the title nuget pack of xproj is defaulting to debug - right behavior? nuget pack of xproj is defaulting to invalid target path Jul 5, 2016
@echarrod
Copy link

echarrod commented Sep 18, 2017

I have the same issue now - "Unable to find 'bin\Release{Project}\bin\Release'." or "Unable to find 'bin\Debug{Project}\bin\Debug'." for either configuration.

My output is 'bin\Release\netstandard1.6'., the same as the original poster, but I am unable to create a project.json file as you suggested, as I'm using VS2017, do you know of another workaround?

@xRoulanDx
Copy link

xRoulanDx commented Jan 31, 2018

I have the same problem. I want to pack my project from my CI pipeline and don't want to add some overhead step for preparing .nuspec file.

@echarrod
Copy link

I managed to get it working by:

  1. Right clicking my project
  2. Click Properties
  3. Select Package from the left hand menu
  4. Select "Generate NuGet package on build"
  5. Using this NuGet package file instead of using nuget pack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants