c# - Visual Studio 在线错误解析解决方案文件位于 *.xproj

标签 c# msbuild asp.net-core azure-devops

我正在处理一个 AspNet5 项目并尝试使用 VSO 来构建该项目。我正在关注文章 here但是当我构建 xproj 文件时,我得到“在 {ProjectPath}.xproj 解析解决方案文件时出错:调用目标引发了异常。”如何在不引发此错误的情况下运行 MsBuild 步骤?

编辑: 我的 xproj 文件几乎完全匹配 xproj here

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
  </PropertyGroup>
  <Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
  <PropertyGroup Label="Globals">
    <ProjectGuid>06d62522-2dad-4393-9b90-17d70e275587</ProjectGuid>
    <RootNamespace>ProjectNamespace</RootNamespace>
    <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
    <OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
  </PropertyGroup>
  <PropertyGroup>
    <SchemaVersion>2.0</SchemaVersion>
    <DevelopmentServerPort>2645</DevelopmentServerPort>
  </PropertyGroup>
  <ItemGroup>
    <DnxInvisibleContent Include="bower.json" />
    <DnxInvisibleContent Include=".bowerrc" />
    <DnxInvisibleContent Include="package.json" />
  </ItemGroup>
  <Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

最佳答案

我找到了这个问题的答案,这是因为 VSO 自动执行了 NuGet 恢复。在我取消选中 NuGet 恢复后,它工作正常。在本教程中,有一个添加“dnu restore”的步骤,这是恢复包的地方。

关于c# - Visual Studio 在线错误解析解决方案文件位于 *.xproj,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34161175/

相关文章:

c# - F# 伤了我的脑子……谁能帮忙把 C# 翻译成 F#?

c# - 使用 Mono.Cecil 更改应用程序类型?

c# - 在 LINQ 中,Join 和从嵌套查询中选择第一项有什么区别

asp.net-mvc - HTTPS SSL 连接不受信任,尽管证书很好

asp.net - 为什么要在Windows Server上的.NET上的.NET Core上运行ASP.NET Core

c# - 如何在 ASP.Net Core 5 Identity 中从 Google OAUTH 获取刷新 token ?

c# - 格式化不带逗号的小数

visual-studio-2008 - 团队 build 与 MSBuild?

msbuild - 如何在多目标项目中仅在所有构建之前调用我的脚本

msbuild - 通过 MSBuild 使用 Authenticode 证书对每个可执行文件进行签名