5
votes

I am working on an AspNet5 project and trying to use VSO to build the project. I am following the article here but when I build the xproj file I get "Error parsing solution file at {ProjectPath}.xproj: Exception has been thrown by the target of an invocation." How can I get the MsBuild step to run without throwing this error?

Edit: My xproj file nearly identically matches the 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>
2
please show us some of your code, e.g. the file {ProjectPath}.xprojAlexander

2 Answers

10
votes

I found the answer to this problem and it is due to VSO automatically doing a NuGet restore. After I unchecked NuGet restore it works fine. In the tutorial there is a step that adds 'dnu restore' which is where the packages are being restored.

5
votes

Ah, found it. It is a property of the VS Build step. enter image description here