【问题标题】:MSBUILD : error MSB1008: Only one project can be specified. Switch: ReleaseMSBUILD : 错误 MSB1008: 只能指定一个项目。开关:释放
【发布时间】:2020-12-11 02:16:51
【问题描述】:

我正在尝试通过使用将我的代码发布到 linux 服务器上

dotnet publish –-configuration Release

在终端命令行中。这应该在 bin/release/publish 中创建一个文件夹,其中包含准备部署到服务器上的所有文件。

但是,我收到一条错误消息,上面写着

“MSBUILD : error MSB1008: only one project can be specified. Switch: Release” 并且没有任何内容发布到 bin 文件夹。

我在 vscode 文件夹中创建了 settings.json 文件夹

{
 "deploy.reloaded": {
     "packages": [
         {
             "name": "Version 1.0.0",
             "description": "Package version 1.0.0",

             "files": [
                 "Schedule.API/bin/Release/netcoreapp3.0/publish/**"
             ]
         }
     ],

     "targets": [
         {
             "type": "sftp",
             "name": "Linux",
             "description": "SFTP folder",

             "host": "192.168.0.152", "port": 22,
             "user": "webuser", "password": "password",

             "dir": "/var/www/schedule",
             "mappings": {
                 "Schedule.API/bin/Release/netcoreapp3.0/publish/**": "/"
             }
         }
     ]
 }
}

【问题讨论】:

    标签: .net-core msbuild dotnet-publish


    【解决方案1】:

    您似乎在此处的第一个破折号中有复制/粘贴错误:

    dotnet publish –-configuration Release
    

    第一个破折号是 (U+2013 : EN DASH)。它应该是一个普通的破折号- (U+002D : HYPHEN-MINUS),就像第二个一样。这应该有效:

    dotnet publish --configuration Release
    

    【讨论】:

      猜你喜欢
      • 2011-04-16
      • 2018-02-01
      • 2018-05-28
      • 2013-06-03
      • 2014-08-07
      • 1970-01-01
      • 2017-10-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多