aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

Class libraries no longer automatically create NuGet package?

Open Daniel15 opened this issue 10 years ago • 6 comments

With prior version of ASP.NET 5, class libraries automatically created NuGet packages on build. This no longer appears to be the case with RC2. Was that an intentional change? I don't see any posts about it in the announcements repo.

Daniel15 avatar May 22 '16 09:05 Daniel15

I'd like to know too. I know they removed the wrap command when dnx was replaced with dotnet. I'm not sure if that tooling change caused this to not be possible anymore?

guardiannite avatar May 23 '16 17:05 guardiannite

now you can open a command prompt in the root of the project folder and type

dotnet pack -c Release

and that will generate the nuget for you

I don't know if there is supposed to be a gui way right now or not or if they will bring that back later

note also that there is no more artifacts folder, the /bin folder is back and that is where the nuget will be found after running the command

joeaudette avatar May 23 '16 17:05 joeaudette

Need to generate nuget package after build , added following in project.json but does seems to be working any idea?

"scripts": { "postbuild": "dotnet pack" }

shafqatalix avatar May 31 '16 18:05 shafqatalix

@jalalions Just today I was adding a prebuild option to my scripts in project.json for something else, and it didn't seem to work. I tried a simple "prebuild" : "echo Hello World!", but with no luck. So... I believe it's an issue with project.json. Try putting this in your .xproj just above the close of the </Project> tag.

<PropertyGroup> <PostBuildEvent> echo Building NuGet Package dotnet pack .. </PostBuildEvent> </PropertyGroup>

I specify .. after dotnet pack, because my project.json is one file up from the bin folder (which is my default starting directory when the project builds).

guardiannite avatar May 31 '16 21:05 guardiannite

@guardiannite Try precompile instead of prebuild ... and I'm inquiring on a schema change for project.json now, which shows (incorrectly) that prebuild/postbuild will work. https://github.com/dotnet/cli/issues/3338

guardrex avatar Jun 02 '16 05:06 guardrex

This issue is being closed because it has not been updated in 3 months.

We apologize if this causes any inconvenience. We ask that if you are still encountering this issue, please log a new issue with updated information and we will investigate.

aspnet-hello avatar Dec 30 '17 23:12 aspnet-hello