我使用VS2013中的一个Nancy模板创建了一个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
Run Code Online (Sandbox Code Playgroud)
我在Heroku上设置了buildpack,如下所示:
heroku config:set BUILDPACK_URL=https://github.com/aktowns/mono3-buildpack.git
Run Code Online (Sandbox Code Playgroud)
我已经读过,如果您通过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)')" />
Run Code Online (Sandbox Code Playgroud)
我不完全确定为什么这不起作用,但我不得不摆脱<Choose>F#项目文件中的标签,以便让F#Formatting项目在Travis上工作(使用Mono构建)以及我必须做的改变看起来像这样(GitHub diff).抱歉缺乏明确性 - 我可能从其他项目中复制了这个.
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>
Run Code Online (Sandbox Code Playgroud)