6
A
回答
7
的fsproj
文件實際上是一個MS Build腳本,所以你可以使用標準的MS建立功能來定義變量(如include路徑),並在項目文件中使用它們。這並不像在F#腳本文件中使用#I
指令那麼簡單,但它應該給你類似的功能。
例如,您可以創建一個文件Includes.proj
定義你包括像這樣的路徑:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<IncludePath>C:\MyIncludePath</IncludePath>
</PropertyGroup>
</Project>
然後你就可以修改fsproj
文件引用上述文件,並使用您參考$(IncludePath)
。可悲的是,這已經在一個文本編輯器來完成(即卸載的項目,進行修改,然後重新裝入):
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="Includes.proj" />
<!-- lots of other stuff -->
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="FSharp.Core" />
<Reference Include="MyAssembly">
<HintPath>$(IncludePath)\MyAssembly.dll</HintPath>
</Reference>
</ItemGroup>
<!-- lots of other stuff -->
</Project>
5
可以在Project Properties
設定的基準文件夾 - >Reference Paths
- >Add Folder
。
如果要以編程方式執行此操作,請在<Project><PropertyGroup><ReferencePath>...
下設置參考路徑,並在<Project><ItemGroup><Reference><HintPath>...
中設置dll的相對路徑。這裏是a script做反向(從fsproj到fsx文件),但它可以給你一些提示繼續。
相關問題
- 1. 什麼是C99中「解鎖」I/O功能的等效物?
- 2. PowerShell中'nohup'的等效物是什麼?
- 3. Dart中Platform.flush()的等效物是什麼?
- 4. Windows的Cloud-Init等效物是什麼?
- 5. 什麼是VB.NET中Program.cs的等效物
- 6. 什麼是blobstore「Create_upload_url」的GCS等效物?
- 7. 什麼是SIOCADDRT的IPv6等效物?
- 8. vb.net中nslookup的等效物是什麼?
- 9. 什麼是React.PropTypes.node的TypeScript等效物?
- 10. 什麼是MovieClip.CreateEmptyMovieClip的AS3等效物?
- 11. jquery中的等效物是什麼
- 12. SVN簽出到新文件夾的TFS等效物是什麼?
- 13. 什麼是.net核心中nuget目標文件的等效物
- 14. 什麼是ASP.NET的等效XAP文件
- 15. 什麼是Rubygem的'-I'標誌的等價物?
- 16. Scala中x [i:]的等價物是什麼?
- 17. iOS:Objective-C中的事件偵聽器的等效物是什麼?
- 18. 什麼是ASP MVC中的django中間件等效物?
- 19. GtkGLArea部件(GTK +)的Vulkan等效物是什麼?
- 20. Mac操作系統上的Windows批處理文件的等效物是什麼?
- 21. AllowCrossTargeting在.fsproj文件
- 22. 什麼是等效的lambda?
- 23. 是否有「python -i」的ruby等價物?
- 24. Mac上的Ubuntu的apt-get命令的等效物是什麼?
- 25. jQuery中的YUI 3的Y.Array()的等效物是什麼
- 26. 什麼是dbx的.gdbinit文件的等價物?
- 27. 什麼是JavaScript的資源文件夾的Java等價物?
- 28. 什麼是「窗口」的Windows 8應用程序的等效物?
- 29. Windows批量中的bash的等效物是什麼?
- 30. WinRT應用程序中的app.config的等效物是什麼?
#I是什麼意思? – User
#I表示IncludePath也查找引用。 –