How do you create a NuGet package from a .NET Core MSBuild project in Visual Studio 2017 RC? -
now have official migration project.json
.csproj
, how generate nuget package output?
i don't know if it's me find hard understand official documentation pages. mention calling msbuild
command line, it's not working me, , besides more hoping specify step directly in .csproj
file itself.
a complete example of how using .csproj
files appreciated.
update: got msbuild output package running command line. trick fill in propertygroup
package metadata described in doc pages. however, still prefer run pack part of normal build process.
update: found better resource understanding new .csproj
format in .net blog page.
i'm packing .net core nuget package msbuild in visual studio 2017 rc using following steps:
- install visual studio 2017 .net core , docker (preview) component.
- create following package information through
new -> project -> c# -> .net core -> console app (.net core)
. - right-click .net core project choose edit projectname.csproj option open .csproj file in visual studio 2017.
save file under propertygroup node following package information:
<propertygroup> <outputtype>exe</outputtype> <targetframework>netcoreapp1.0</targetframework> <packageid>testnetcorepackage</packageid> <packageversion>1.0.0</packageversion> <authors>weiwei</authors> <description>test .net core package</description> <packagerequirelicenseacceptance>false</packagerequirelicenseacceptance> <packagereleasenotes>first release</packagereleasenotes> <copyright>copyright 2016 (c) contoso corporation. rights reserved.</copyright> <packagetags>net core</packagetags> </propertygroup>
open developer command prompt vs 2017 rc , type
cd *your project file path*
command navigate project file path.type
msbuild projectname.csproj /t:pack
, command pack .net core package. generate in bin\debug folder in project path.
Comments
Post a Comment