ошибка MSB3094: «DestinationFiles» относится к 1 элементу (ам), а «SourceFiles» - к 428 элементам. - PullRequest
2 голосов
/ 06 мая 2020

Я набираю cmd:

dotnet publish MyProject.Web.csproj --configuration Release --framework netcoreapp3.1 --runtime win-x64 --self-contained true --output '\bin\Release\netcoreapp3.1\publish'

И получаю следующую ошибку.

C:\Program Files\dotnet\sdk\3.1.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(152,5): error MSB3094: "DestinationFiles" refers to 1 item(s), and "SourceFiles" refers to 428 item(s). They must have the same number of items. [C:\BuildAgent\work\7e7906b985af1c3\src\MyProject.Web\MyProject.Web.csproj]

Вот мой файл MyProject.Web.csproj

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <Authors>MyCompany Ltd</Authors>
    <Company>MyCompany Ltd</Company>
    <AssemblyVersion>1.0.0</AssemblyVersion>
    <FileVersion>1.0.0</FileVersion>
    <Version>1.0.0</Version>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Autofac" Version="5.1.4" />
    <PackageReference Include="Autofac.Extensions.DependencyInjection" Version="6.0.0" />
    <PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="7.0.0" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.3" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.3" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.3">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="Swashbuckle.AspNetCore" Version="5.4.1" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\MyProject.EntityFramework\MyProject.EntityFramework.csproj" />
    <ProjectReference Include="..\MyProject\MyProject.csproj" />
  </ItemGroup>

  <ItemGroup>
    <Content Update="appsettings.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
  </ItemGroup>

</Project>

Я видел похожие решения для stackoverflow, но все они предназначены для Visual Studio. Я запускаю команду напрямую из cmd. Кто-нибудь знает, что вызывает это?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...