ServiceModel and f#

早过忘川 提交于 2019-12-11 09:47:03

问题


I am just starting with f# so the question may seem easy for some of you. so, I am trying to use SyndicationFeed which is located in System.ServiceModel.Syndication namespace. I added following references: System.ServiceModel and System.ServiceModel.Web to the project. The result is that it builds successfully, but when I switch to "F# interactive" window I got an error which reads "error FS0039: The namespace 'ServiceModel' is not defined".

I goggled that I should also add reference to FSharp.PowerPack, in order to get rid this error but unfortunately it did not help. So guys I count on your help


回答1:


references in script files (and FSI) are added via #r directive

#r "System.ServiceModel"

you can add parts like below to you source code so it can be both used by fsc and sent to fsi

#if INTERACTIVE
#r "System.ServiceModel"
#endif


来源:https://stackoverflow.com/questions/3521706/servicemodel-and-f

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!