VSTO 2012:向后兼容 [英] VSTO 2012: backward compatibility

查看:1232
本文介绍了VSTO 2012:向后兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于最近在 Visual Studio工具对于Office 2012 (VSTO 2012)的<一个href="http://blogs.msdn.com/b/somasegar/archive/2013/03/04/now-available-office-developer-tools-for-visual-studio-2012.aspx"相对=nofollow>可供下载。

Since lately the Visual Studio Tools For Office 2012 (VSTO 2012) are available for download.

尚可用于老年人的Office版本(2007,2010)发展中加载的解决方案新版本?是否有任何优势VSTO 4.0(除办公室2013支持)

Can this new version still used for developing Add-In solutions for older Office versions (2007,2010)? Are there any advantages over VSTO 4.0 (besides Office 2013 support)

推荐答案

是的,它可以。我使用VS2012为Excel 2007中的项目,它工作正常。

Yes, it can. I'm using VS2012 for an Excel 2007 project and it works fine.

关键是要改变项目文件中的调试路径,以便VS使用Office的旧版本的应用程序,你的插件可以。

The trick is to change the debug path in your project file so that VS uses the older version of the Office app your plugin is for.

  1. 创建您的VSTO项目(让VS创建项目为Office 2010)
  2. 编辑该项目文件并找到&LT; ProjectProperties&GT; 主机名属性。这将是一个子元素&LT; VisualStudio中&GT; 元素
  3. 更改 DebuginfoExeName 属性的值&LT; ProjectProperties&GT; 属性是路径的旧版本Office应用程序.exe文件
  4. 保存项目
  1. Create your VSTO project (let VS create the project for Office 2010)
  2. Edit the project file and find the <ProjectProperties> with a HostName attribute. It will be a child element of a <VisualStudio> element.
  3. Change the DebuginfoExeName attribute value of the <ProjectProperties> attribute to be the path to the older version of the Office application .exe file
  4. Save your project

现在,当你去调试你的应用程序应该启动您的Office应用程序的旧版本,并连接到该进程加载VSTO。

Now when you go to debug your app it should launch the older version of your Office app and attach to that process to load your VSTO.

在我的项目,新的&LT; ProjectProperties&GT; 元素看起来像这样的Excel 2007中:

In my project, the new <ProjectProperties> element looks like this for Excel 2007:

<ProjectProperties
    HostName="Excel"
    HostPackage="{20A848B8-E01F-4801-962E-25DB0FF57389}" OfficeVersion="14.0"
    VstxVersion="4.0"
    ApplicationType="Excel"
    Language="cs"
    TemplatesPath=""
    DebugInfoExeName="#Software\Microsoft\Office\12.0\Excel\InstallRoot\Path#excel.exe"
    AddItemTemplatesGuid="{51063C3A-E220-4D12-8922-BDA915ACD783}" />

部署也能正常工作。我部署我的外接通过ClickOnce的,它被添加到Excel 2007客户端无需任何额外的更改。

Deployment also works fine. I deploy my add-in via ClickOnce and it is added to Excel 2007 clients without any additional changes.

这篇关于VSTO 2012:向后兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆