When dynamically referencing assemblies in .fsx using #I
and #r
, VS highlights the following usages of imported types and writes "The namespace or module 'XXX' is not defined". Is it ok?
For example, in the following code
#I @".\Tools\FAKE"
#r "FakeLib.dll"
open Fake
Target "Hello" (fun _ -> trace "hello!")
Run "Hello"
VS highlights Fake
and says "The namespace or module 'Fake' is not defined", it also highlights Target
and Run
. I have this problem in VS 2010 SP1 and in VS 11 CTP. This issue makes writing F# scripts a bit harder task than it could be.
By the way, IntelliSence for "common" types works well. FakeLib.dll
and FakeLib.xml
are present in the .\Tools\FAKE
directory. The code runs well.
Update 1
Here's the screenshot of the situation. You can see that VS resolves assembly FakeLib
correctly (in a tooltip), and that at the same time Intellisense "see" standard types (tooltip over Console
) class.
Update 2
I think there's something wrong with the IntelliSense on my work workstation, because it (IntelliSense) behaves itself quite strange. When I start VS and open .fsx file, IntelliSense refuses to resolve even standard types/classes, and it doesn't underlines FAKE
classes, it does nothing. But after some period of time and some manipulation over code IntelliSense starts working for standard types and underlines FAKE
types.
Moreover, when I've created the similar code on my home workstation there were no problems, IntelliSense works as it should.