2015-12-08 96 views
5

我正在開發一個AspNet5項目並嘗試使用VSO構建項目。我正在關注文章here,但是當我構建xproj文件時,我得到了「{ProjectPath} .xproj中的錯誤解析解決方案文件:調用的目標引發了異常。」我怎樣才能讓MsBuild步驟在不拋出此錯誤的情況下運行?Visual Studio Online錯誤解析解決方案文件,位於* .xproj

編輯: 我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> 
+0

請向我們展示您的一些代碼,例如文件{ProjectPath} .xproj – Alexander

回答

10

我找到了答案,這個問題,這是由於VSO自動做的NuGet恢復。我沒有選中NuGet恢復後,它工作正常。在教程中,有一個步驟添加了「dnu restore」,這是恢復軟件包的地方。

+0

我真的希望微軟能夠爲ASP.NET 5添加正確的構建步驟和部署步驟,現在使用它是很痛苦的......我在遇到許多問題時遇到了許多問題,包括髮布的問題。 .. –

+0

VSO上的NuGet恢復設置在哪裏?我沒有在構建或VSO設置中看到它。任何指針將不勝感激。 – Rajesh

+0

我還想知道在執行「取消選中NuGet恢復」後執行的操作。 –

5

啊,找到它了。這是VS Build步驟的一個屬性。 enter image description here

相關問題