Ядро asp.net Дублирующиеся сведения о сборке для DevOps Azure - PullRequest
0 голосов
/ 04 октября 2018

У меня есть основное приложение asp.net, которое я создаю с помощью Azure DevOps.Сборка и тестирование работает нормально.Но когда публикация выполняется, я получаю эту ошибку:

2018-10-04T13:34:04.3032611Z obj\release\netcoreapp2.1\FelicitasCustomerportal.AssemblyInfo.cs(10,12): error CS0579: Duplicate 'System.Reflection.AssemblyCompanyAttribute' attribute [D:\a\1\s\FelicitasCustomerportal\FelicitasCustomerportal.csproj]
2018-10-04T13:34:04.3039062Z obj\release\netcoreapp2.1\FelicitasCustomerportal.AssemblyInfo.cs(11,12): error CS0579: Duplicate 'System.Reflection.AssemblyConfigurationAttribute' attribute [D:\a\1\s\FelicitasCustomerportal\FelicitasCustomerportal.csproj]
2018-10-04T13:34:04.3047800Z obj\release\netcoreapp2.1\FelicitasCustomerportal.AssemblyInfo.cs(12,12): error CS0579: Duplicate 'System.Reflection.AssemblyFileVersionAttribute' attribute [D:\a\1\s\FelicitasCustomerportal\FelicitasCustomerportal.csproj]
2018-10-04T13:34:04.3047914Z obj\release\netcoreapp2.1\FelicitasCustomerportal.AssemblyInfo.cs(13,12): error CS0579: Duplicate 'System.Reflection.AssemblyInformationalVersionAttribute' attribute [D:\a\1\s\FelicitasCustomerportal\FelicitasCustomerportal.csproj]
2018-10-04T13:34:04.3047967Z obj\release\netcoreapp2.1\FelicitasCustomerportal.AssemblyInfo.cs(14,12): error CS0579: Duplicate 'System.Reflection.AssemblyProductAttribute' attribute [D:\a\1\s\FelicitasCustomerportal\FelicitasCustomerportal.csproj]
2018-10-04T13:34:04.3055163Z obj\release\netcoreapp2.1\FelicitasCustomerportal.AssemblyInfo.cs(15,12): error CS0579: Duplicate 'System.Reflection.AssemblyTitleAttribute' attribute [D:\a\1\s\FelicitasCustomerportal\FelicitasCustomerportal.csproj]
2018-10-04T13:34:04.3055295Z obj\release\netcoreapp2.1\FelicitasCustomerportal.AssemblyInfo.cs(16,12): error CS0579: Duplicate 'System.Reflection.AssemblyVersionAttribute' attribute [D:\a\1\s\FelicitasCustomerportal\FelicitasCustomerportal.csproj]

На моем ноутбуке и рабочем столе я могу создавать и публиковать без каких-либо проблем.Кроме того, поскольку у меня нет никакого файла AssemblyInfo, я очень смущен этим.

Мой YAML сборки выглядит следующим образом:

resources:
- repo: self
queue:
  name: Hosted VS2017
#Your build pipeline references the ‘BuildConfiguration’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971
#Your build pipeline references the ‘BuildConfiguration’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971
#Your build pipeline references the ‘BuildConfiguration’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971
steps:
- task: DotNetCoreCLI@2
  displayName: 'dotnet build'
  inputs:
    projects: '**/*.csproj'

    arguments: '--configuration $(BuildConfiguration)'


- task: DotNetCoreCLI@2
  displayName: 'Run Tests'
  inputs:
    command: test

    projects: '**/*Tests*.csproj'

    arguments: '--configuration $(BuildConfiguration)'


- task: DotNetCoreCLI@2
  displayName: 'dotnet publish'
  inputs:
    command: publish

    arguments: '--configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)'


- task: PublishBuildArtifacts@1
  displayName: 'Publish Artifact: drop'

Я попытался добавить эти теги в csproj:

false false

Но затем я получил ошибку на лазурной (локально все еще все было в порядке): Program.cs (11,28): ошибка CS0017: Программа имеет более одной точки входаопределены.

Я также сравнил его с другим конвейером (также ядром asp.net), который прекрасно работает без двух тегов выше.Что здесь может быть не так?

РЕДАКТИРОВАТЬ: я обнаружил, что сборка и развертывание работает, когда я использую Visual Studio Build.

...