在构建我的一个较大的项目时,我遇到了一个与FSharp.Core
相关的奇怪错误,并且该错误不包含任何位置信息,以帮助我找出问题所在。
编译错误为error FS0193: The module/namespace 'Microsoft.FSharp.Linq.RuntimeHelpers' from compilation unit 'FSharp.Core' did not contain the namespace, module or type 'LeafExpressionConverter'
起初我以为是因为该项目使用的是旧的Powerpack LINQ,所以我将其剥离了。然后我想也许它与使用Entity Framework 4.3而不是5.0有关,所以我升级了。同样的错误。我仍在编译.NET 4.0,而不是4.5 ......也许这是原因的一部分?
我将Doctypes.fsproj
XML与同一解决方案中的其他项目进行了比较,一切看起来都很正常。 FSharp.Core
引用只是<Reference Include="FSharp.Core" />
这是一个非常的大型项目,因此创建一个小的可重现版本的错误可能需要一段时间来弄明白,我想知道这里是否有人有快速回答。
这是MSBUILD输出:
19> C:\Program Files (x86)\Microsoft SDKs\F#\3.0\Framework\v4.0\fsc.exe -o:obj\Debug\DTC.Doctypes.dll -g --debug:full --noframework --define:DEBUG --define:TRACE --doc:bin\Debug\Doctypes.XML --optimize- --tailcalls- --resource:statutes_ebook_cover.jpg -r:A:\svn\dtc\Publisher\Doctypes\bin\Debug\CsvHelper.dll -r:A:\svn\dtc\Publisher\Data\bin\Debug\DTC.Data.dll -r:A:\svn\dtc\Publisher\Formats\bin\Debug\DTC.Formats.dll -r:A:\svn\dtc\Publisher\Parser\bin\Debug\DTC.Parser.dll -r:A:\svn\dtc\Publisher\ReferenceParser\bin\Debug\DTC.ReferenceParser.dll -r:A:\svn\dtc\Publisher\Shared\bin\Debug\DTC.Shared.dll -r:A:\svn\dtc\Publisher\Solr\bin\Debug\DTC.Solr.dll -r:A:\svn\dtc\Publisher\Utilities\bin\Debug\DTC.Utilities.dll -r:A:\svn\dtc\Publisher\Doctypes\bin\Debug\EntityFramework.dll -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\2.0\Runtime\v4.0\FSharp.Core.dll" -r:A:\svn\dtc\Publisher\packages\HtmlAgilityPack.1.4.6\lib\Net40\HtmlAgilityPack.dll -r:A:\svn\dtc\Publisher\packages\DotNetZip.1.9.1.8\lib\net20\Ionic.Zip.dll -r:A:\svn\dtc\Publisher\packages\LegislativeData.1.0.2773.180\lib\net40\LegislativeData.dll -r:A:\svn\dtc\Publisher\packages\LibrarianData.1.0.2773.6\lib\net40\Librarian.Data.dll -r:A:\svn\dtc\Lib\Office12\Microsoft.Office.Interop.Excel.dll -r:A:\svn\dtc\Lib\Office12\Microsoft.Office.Interop.Word.dll -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll" -r:A:\svn\dtc\Publisher\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll -r:A:\svn\dtc\Publisher\Repository\bin\Debug\Repository.dll -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.ComponentModel.DataAnnotations.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Configuration.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Data.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Data.Entity.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Numerics.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Runtime.Serialization.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.dll" --target:library --warn:4 --warnaserror --warnaserror:76 --vserrors --validate-type-providers --LCID:1033 --utf8output --fullpaths --flaterrors --highentropyva- "C:\Users\dfitch\AppData\Local\Temp\.NETFramework,Version=v4.0.AssemblyAttributes.fs" Helpers.fs Paths.fs FolioImport.fs Epub.fs Kindle.fs Ebooks.fs SharedLaw.fsi SharedLaw.fs SharedIndex.fs HistoryLinks.fs AdministrativeCodeHeaders.fs AdministrativeCode.fs AdministrativeCodeTOC.fs AdministrativeCodeIndex.fs SCRHeaders.fs Register.fs StatuteHeaders.fs Statutes.fs StatutesTOC.fs StatutesIndex.fs CrossReferences.fs SupremeCourtRules.fs Constitution.fs SessionTypes.fs CrDocs.fs EmergencyRules.fs OracleSession.fs LatsSession.fs TestSessionData.fs Session.fs Votes.fs SessionText.fs FiscalEstimates.fs LatsBulletinIndex.fs SharedBulletinIndex.fs AuthorIndex.fs SubjectIndex.fs JournalIndex.fs CrIndex.fs ActIndex.fs SectionsAffected.fs LCAmendmentMemos.fs LCActMemos.fs LCDocuments.fs RecordsOfCommitteeProceedings.fs VetoMessages.fs AssemblyInfo.fs Journals.fs Calendars.fs ProposalText.fs AmendmentText.fs EnrolledBillsText.fs RDAttachments.fs ActText.fs Budget.fs LegislativeRules.fs DraftingManual.fs AdminRulesManual.fs DraftingFiles.fs ExecutiveOrders.fs CapitolHeadlines.fs TownLawForms.fs FolioBillHist.fs FolioLaw.fs FolioSessionImport.fsi FolioSessionImport.fs FolioSession.fs FolioMisc.fs FolioIndexes.fs FolioCr.fs Wislaw.fs Help.fs Disclaimers.fs Dnotes.fs CCC.fs LCMemos.fs oag.fs AdministrativeCodeCites.fs StatutesRepealedRenumbered.fs LRBUserProcedures.fs LRBDraftingManual.fs
19>FSC: error FS0193: The module/namespace 'Microsoft.FSharp.Linq.RuntimeHelpers' from compilation unit 'FSharp.Core' did not contain the namespace, module or type 'LeafExpressionConverter'
19>C:\Program Files (x86)\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets(155,9): warning MSB5021: "Fsc" and its child processes are being terminated in order to cancel the build.
19>C:\Program Files (x86)\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets(155,9): error : Build was canceled.
答案 0 :(得分:7)
您的MSBuild输出显示对...的引用
C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\2.0\Runtime\v4.0\FSharp.Core.dll
。
这是FSharp.Core的F#2.0版本。您需要引用F#3.0版本:
C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\3.0\Runtime\v4.0\FSharp.Core.dll