FS0010:编译AssemblyInfo.fs时不完整的结构化构造

时间:2017-08-22 16:26:09

标签: f#

我正在尝试在TeamCity上构建一个F#项目。不幸的是构建代理没有安装F#所以我已经将FSharp.Compiler.Tools nuget包添加到我的项目中。

当teamcity尝试构建我的项目时,我收到以下错误(在从visual studio类库模板创建的全新项目中)。

[Fsc] Microsoft (R) F# Compiler version 4.1
[15:12:00][Fsc] Copyright (c) Microsoft Corporation. All Rights Reserved.
[15:12:02][Fsc] 
[15:12:02][Fsc] C:\TeamCity\work\3c40581f0aabd3be\Source\MyProject\AssemblyInfo.fs(43, 1): error FS0010: Incomplete structured construct at or before this point in definition
[15:12:03][Step 8/21] Error message is logged

该项目在VS2017中本地构建良好,并在命令提示符下使用MSBuild。

有什么方法可以解决这个问题吗?我没有权限在构建代理上安装F#。

编辑:这是AssemblyInfo.fs的内容:     命名空间MyProject.AssemblyInfo

open System.Reflection
open System.Runtime.CompilerServices
open System.Runtime.InteropServices

// General Information about an assembly is controlled through the following 
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[<assembly: AssemblyTitle("MyProject")>]
[<assembly: AssemblyDescription("")>]
[<assembly: AssemblyConfiguration("")>]
[<assembly: AssemblyCompany("")>]
[<assembly: AssemblyProduct("MyProject")>]
[<assembly: AssemblyCopyright("Copyright © 2017")>]
[<assembly: AssemblyTrademark("")>]
[<assembly: AssemblyCulture("")>]

// Setting ComVisible to false makes the types in this assembly not visible 
// to COM components.  If you need to access a type in this assembly from 
// COM, set the ComVisible attribute to true on that type.
[<assembly: ComVisible(false)>]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[<assembly: Guid("7a1189cf-d923-4367-991c-d95b1f045712")>]

// Version information for an assembly consists of the following four values:
// 
//       Major Version
//       Minor Version 
//       Build Number
//       Revision
// 
// You can specify all the values or you can default the Build and Revision Numbers 
// by using the '*' as shown below:
// [<assembly: AssemblyVersion("1.0.*")>]
[<assembly: AssemblyVersion("1.0.0.0")>]
[<assembly: AssemblyFileVersion("1.0.0.0")>]

do
    ()

1 个答案:

答案 0 :(得分:0)

好的,似乎GitVersion正在teamcity代理上被调用,并且AssemblyInformationalVersion属性追加到AssemblyInfo.fs的末尾(在do ()之后)。在AssemblyInformationalVersion块上方添加空do ()可解决问题:gitversion然后修改现有属性的值,而不是添加新属性。

相关问题