Which Namespace For EnvDTE?
I was playing with writing a Visual Studio Add-In in F# and I was following along with some stuff that Gabriel Culliver and Brian McNamara had posted in response to this question.
When I put the foll开发者_如何学Goowing code into a .fs file in VS 2010
namespace TestFSharpAddIn
open System
open Extensibility
//open EnvDTE
//open EnvDTE80
do()
It gives me the following error when I attempt to build:
The namespace or module 'Extensibility' is not defined
I have added a reference to Extensibility.dll so I'm assuming that the namespace within the Extensibility dll is not "Extensibility". But it doesn't seem to be possible to open the Extensibility dll in the Object Browser. Am I missing something obvious here? How can I find out which namespaces are present in Extensibility.dll?
I also tried this with EnvDTE with pretty much the same issue.
The project is a modified C# template (per Brian's answer) and I can comment out everything in this .fs file and it builds so I think the project/solution itself is ok. There's a second .fs file in the project which builds fine but, of course, it doesn't need to reference any of the EnvDTE or Extensibility assemblies.
EDIT:
Additional Information:
Extensibility.dll
Version 7.0.3300.0
Path: C:\Program Files\Common Files\Microsoft Shared\MSEnv\PublicAssemblies\Extensibility.dll
I'm not sure what's going on in with your situation but I've verified this works in F#. Here are my steps
- New F# application
- Add a Reference to the Extensibility DLL
I then added the following code to verify the reference. It compiles cleanly.
open Extensibility
let x : IDTExtensibility2 = null
printfn "foo"
The path I used for the extensibility DLL is
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Common\Extensibility.dll
精彩评论