简体   繁体   中英

ServiceModel and f#

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM