2014-02-24 28 views
3

我已經使用VS2013中的一個Nancy模板創建了一個F#項目。代碼基本上就是模板創建的內容。構建VS2013 Heroku上的F#項目失敗,並顯示「必需屬性」項目「導入爲空」

我可以將創建的.sln文件導入到Xamarin工作室,它的所有構建和運行都沒有任何錯誤或問題。

當我試圖推動該項目達到Heroku的,雖然我得到的錯誤:

/tmp/build_b3e2706f-20c8-421e-a1ce-781831880466/NancyFirstProject/NancyFirstProject.fsproj: error : /tmp/build_b3e2706f-20c8-421e-a1ce-781831880466/NancyFirstProject/NancyFirstProject.fsproj: The required attribute "Project" in Import is empty 

我已經設置在Heroku的buildpack如下:

heroku config:set BUILDPACK_URL=https://github.com/aktowns/mono3-buildpack.git 

我讀過,如果您通過VS2013升級項目,則會發生類似的錯誤。

這與我的錯誤是一樣的嗎? 是否有另一個我可以用來解決這個問題的buildpack?

我想我可以在Xamarin中創建解決方案,但如果可能的話,我想堅持vs2013。

編輯:**

就注意到了這一點在.fsproj文件:

<Choose> 
    <When Condition="'$(VisualStudioVersion)' == '11.0'"> 
     <PropertyGroup> 
     <FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath> 
     </PropertyGroup> 
    </When> 
    <Otherwise> 
     <PropertyGroup> 
     <FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath> 
     </PropertyGroup> 
    </Otherwise> 
    </Choose> 
    <Import Project="$(FSharpTargetsPath)" Condition="Exists('$(FSharpTargetsPath)')" /> 
+0

什麼版本的單聲道是這個 – knocte

回答

5

我不完全知道爲什麼,這是不行的,但我不得不擺脫F#項目文件中的<Choose>標記,以便使F#格式項目在Travis上工作(使用Mono構建)以及必須執行的更改looks like this (GitHub diff)。對不起,缺乏清晰度 - 我可能從一些其他項目複製了這個。

的差異取代了<Choose>標籤具有:

<PropertyGroup> 
    <FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath> 
</PropertyGroup> 
<PropertyGroup Condition="'$(VisualStudioVersion)' == '11.0' Or $(OS) != 'Windows_NT'"> 
    <FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath> 
</PropertyGroup> 
+0

謝謝,這個工程,並讓我到我的下一個構建錯誤,這是從NuGet無法解析南希。 –

0

這個問題現在可以通過使用來自here的buildpack並指定.NET Framework的更高版本來解決。