且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用MSBuild为此项目文件夹中的所有文件创建MSdeploy包

更新时间:2023-10-17 09:04:58

In您的命令行只需将 / p:FilesToIncludeForPublish = AllFilesInProjectFolder 添加到您的msbuild调用中。当你在它时,你可能还想传递一个特定的配置来构建 / p:Configuration = Release

In your commandline simply add /p:FilesToIncludeForPublish=AllFilesInProjectFolder to your msbuild invocation. While you're at it, you may also want to pass in a specific configuration to build /p:Configuration=Release

所以:

 msbuild myproject.csproj /t:package /p:FilesToIncludeForPublish=AllFilesInProjectFolder /p:Configuration=Release

提示:其中许多设置都存储在项目文件中。在记事本中打开文件,并比较更改某些设置后所做的更改。 < propertygroup> 中的任何项目通常也可以通过命令行传递,并使用 / p:参数。

Tip: Many of these settings are stored in your project file. Open up your file in Notepad and compare the changes made when you have changed some settings. Any item that's in a <propertygroup> can usually be passed along through the commandline as well using the /p: parameter.