如何创建基于F#的Visual Studio加载项?

编程入门 行业动态 更新时间:2024-10-24 06:36:01
本文介绍了如何创建基于F#的Visual Studio加载项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

即使安装了F#,Visual Studio 2008(可能还有2010)也仅提供用于C#,VB.NET和C ++的加载项项目模板.

Even with F# installed, Visual Studio 2008 (and probably 2010) only provides Add-In project templates for C#, VB.NET and C++.

那么,如何创建基于F#的加载项?

So, how to create a F# based Add-In?

我尝试使用实现IDTExtensibility2的新类创建F#类库项目,设置正确的引用(EnvDTE,Extensibility等),从C#加载项(主要是命令行)中复制一些项目属性进行调试),并手动创建.AddIn清单文件,但没有成功.启动VS时,可用插件中未列出我的加载项.

I have tried to create a F# class library project with a new class implementing IDTExtensibility2, setting the correct references (EnvDTE, Extensibility, ...), copying a few project attributes from the C# Add-In (mainly the command line for debugging), and creating the .AddIn manifest file by hand, but no success. When VS is launched, my Add-In is not listed in the available ones.

缺少哪些步骤?在某处进行某种COM注册?

What are the missing steps? Some kind of COM registration somewhere?

推荐答案

我终于发现问题出在哪里:我只是忘记将.AddIn文件放在AddIn目录中(C#向导会自动执行此操作).

I finally found what went wrong: I simply forgot to put the .AddIn file in the AddIn directory (the C# wizard is doing this automatically).

因此,要为Visual Studio创建基于F#的加载项,

So, to create a F# based Add-In for Visual Studio:

  • 创建一个新的F#类库项目
  • 在项目中添加一些参考程序集(主要是EnvDTE,EnvDTE80,EnvDTE90,可扩展性)
  • 创建一个实现IDTExtensibility2的新类
  • 将基于C#的加载项项目的调试属性复制到F#项目中
  • 复制.AddIn清单文件,并根据您的F#项目对其进行修改 * ..并且不要忘记将该新文件复制到用户会话的AddIn目录中
  • 享受!
  • Create a new F# class library project
  • Add a few reference assemblies to the project (mainly EnvDTE, EnvDTE80, EnvDTE90, Extensibility)
  • Create a new class implementing IDTExtensibility2
  • Copy the debugging properties of a C# based Add-In project into your F# project
  • Copy the .AddIn manifest file, and modify it according to your F# project *.. and don't forget to copy that new file in the AddIn directory for the user session
  • enjoy!

更多推荐

如何创建基于F#的Visual Studio加载项?

本文发布于:2023-11-15 23:42:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1599009.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:加载   Visual   Studio

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!