1

我有一个由多个 .NET Core (2.1) 项目和一个用 Blazor (0.4.0) 编写的 Web 解决方案组成的解决方案。

我刚刚开始收到以下错误:

错误 MSB3073 命令“dotnet”C:\Users\YYY.nuget\packages\microsoft.aspnetcore.blazor.build\0.4.0\targets../tools/illink/illink.dll”-c 链接 -u 链接 -t --verbose -d "C:\Users\YYY.nuget\packages\microsoft.aspnetcore.blazor.build\0.4.0\targets../tools/mono/bcl/" -d "C:\Users\YYY. nuget\packages\microsoft.aspnetcore.blazor.build\0.4.0\targets../tools/mono/bcl/Facades/" -o "C:\TFS2\BAP - Desktop\Main\Source\Code\Framework.Desktop \obj\Debug\netstandard2.0\blazor/linker/" -x "C:\Users\YYY.nuget\packages\microsoft.aspnetcore.blazor.build\0.4.0\targets\BuiltInBclLinkerDescriptor.xml" -x "C :\TFS2\BAP - Desktop\Main\Source\Code\Framework.Desktop\obj\Debug\netstandard2.0\blazor\linker.descriptor.xml" -a "C:\Users\YYY.nuget\packages\microsoft. aspnetcore.blazor\0.4.0\lib\netstandard2.0\Microsoft.AspNetCore.Blazor.dll" -a "C:\Users\YYY.nuget\packages\microsoft.aspnetcore.blazor.browser\0.4.0\lib\netstandard2.0\Microsoft.AspNetCore.Blazor.Browser. dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.extensions.dependencyinjection\2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.dll" -a "C:\Program Files\ dotnet\sdk\NuGetFallbackFolder\microsoft.extensions.dependencyinjection.abstractions\2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft .extensions.localization.abstractions\2.1.0\lib\netstandard2.0\Microsoft.Extensions.Localization.Abstractions.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.extensions.logging.abstractions\ 2.1。0\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.componentmodel.annotations\4.5.0\lib\netstandard2.0\System .ComponentModel.Annotations.dll" -a "C:\TFS2\BAP - 桌面\Main\Source\Code\BlazorDevExtreme\bin\Debug\netstandard2.0\BlazorDevExtreme.dll" -a "C:\TFS2\BAP - 桌面\Main\Source\Code\XXXXXX.IdentityProvider.Model\bin\Debug\netstandard2.0\XXXXXX.IdentityProvider.Model.dll" -a "C:\TFS2\BAP - Desktop\Main\Source\Code\XXXXXX.Utilities \bin\Debug\netstandard2.0\XXXXXX.Utilities.dll" -a "C:\TFS2\BAP - Desktop\Main\Source\Code\XXXXXX.ServiceLayer.Analytic.Web\Lib\DevExpress.CodeParser.v18.1 .dll" -a "C:\TFS2\BAP - Desktop\Main\Source\Code\Framework.Constants\bin\Debug\netstandard2.0\Framework.Constants.dll"-a "C:\TFS2\BAP - Desktop\Main\Source\Code\Framework.Shared\bin\Debug\netstandard2.0\Framework.Shared.dll" -a "C:\TFS2\BAP - Desktop\Main\ Source\Code\XXXXXX.ServiceLayer.Analytic.Web\Lib\DevExpress.Data.v18.1.dll" -a "C:\TFS2\BAP - Desktop\Main\Source\Code\Framework.Desktop\obj\Debug\ netstandard2.0\Framework.Desktop.dll"" 以代码 1 退出。Framework.Desktop C:\Users\YYY.nuget\packages\microsoft.aspnetcore.blazor.build\0.4.0\targets\Blazor.MonoRuntime.targets 441" 以代码 1 退出。Framework.Desktop C:\Users\YYY.nuget\packages\microsoft.aspnetcore.blazor.build\0.4.0\targets\Blazor.MonoRuntime.targets 441" 以代码 1 退出。Framework.Desktop C:\Users\YYY.nuget\packages\microsoft.aspnetcore.blazor.build\0.4.0\targets\Blazor.MonoRuntime.targets 441

我真的不知道为什么会这样。

我知道任何人都很难解决 - 但如果你能指出为什么会发生这样的错误,那么我可能能够解决它:)

我已尝试清理/重建,PC 也已多次关闭和打开,但错误仍然存​​在。

有任何想法吗?它与.NET Core 有关吗?

4

1 回答 1

2

在失败的项目上运行 dotnet build 后,我得到了一个具体的错误,并发现我的 .csproj 文件中有一些错误。

由于某种原因,一些 ItemGroup 元素被自动插入:

<ItemGroup>
    <Reference Include="DevExpress.CodeParser.v18.1">
      <HintPath>..\XXX.ServiceLayer.Analytic.Web\Lib\DevExpress.CodeParser.v18.1.dll</HintPath>
    </Reference>
  </ItemGroup>

  <ItemGroup>
    <Content Update="Components\FormGroupRowLabeledDateBox\FormGroupRowLabeledDateBox.cshtml">
      <Pack>$(IncludeRazorContentInPack)</Pack>
    </Content>
    <Content Update="Components\FormGroupRowLabeledTextBox\FormGroupRowLabeledTextBox.cshtml">
      <Pack>$(IncludeRazorContentInPack)</Pack>
    </Content>
  </ItemGroup>

通过从我失败的 .csproj 文件中删除上述内容,错误消失了。

于 2018-06-26T11:58:19.393 回答