有没有办公室的.NET 4兼容的版本外接沉? [英] Is there a .NET 4 compatible version of the Office Add-in Shim?

查看:217
本文介绍了有没有办公室的.NET 4兼容的版本外接沉?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在创建一个基于.NET的Office加载项的没有的VSTO,这是必要的(或者至少是希望)使用COM垫片加载的加载项,提供进程隔离因此,任何飞机坠毁的效果是有限的,以该插件。

When creating a .NET-based Office add-in without VSTO, it's necessary (or at least desirable) to use a "COM shim" that loads the add-in, to provide process isolation so that the effect of any crash is limited to that add-in.

微软(我认为)只要我使用已经在C ++垫片的项目,但我现在为时已晚,从.NET 1.1升级我的项目(​​是的,真的)到.NET 4。

Microsoft (I think) provided the C++ shim project that I've been using, but now I'm belatedly upgrading my project from .NET 1.1 (yes, really) to .NET 4.

我得到一个编译器垫片项目警告:

I'm getting a compiler warning from the shim project:

警告C4996:'CorBindToRuntimeEx的:这个API已经去precated。请参阅 http://go.microsoft.com/fwlink/?LinkId=143720 了解更多详情。

warning C4996: 'CorBindToRuntimeEx': This API has been deprecated. Refer to http://go.microsoft.com/fwlink/?LinkId=143720 for more details.

不幸的是,这个环节不actualy告诉我怎么解决这个问题,因为我不明白,原来,我不是在一个位置,做到这一点。

Unfortunately, this link doesn't actualy tell me how to fix it, and since I don't understand the original, I'm not in a position to do this.

仅供参考,违规code是这样的:

FYI, the offending code looks like this:

// Load runtime into the process ...
hr = CorBindToRuntimeEx(
     // version, use default
    0,
     // flavor, use default
    0,
     // domain-neutral"ness" and gc settings
    STARTUP_LOADER_OPTIMIZATION_MULTI_DOMAIN |  STARTUP_CONCURRENT_GC,
    CLSID_CorRuntimeHost, 
    IID_ICorRuntimeHost, 
    (PVOID*) &m_pHost);

是否有垫片项目的新版本是否可用?我一直无法找到一个...

Is there a new version of the shim project available? I've been unable to find one...

推荐答案

我发现的时,这对于VS2010的溶液。它还包括如何在外接使用垫片,这是一件好事我总是发现有问题时,设置断点。

I found this, which is a solution for VS2010. It also covers how to set breakpoints in your add-in when using a shim, which is something I'd always found problematic.

我可以将其转换为一个VS2012的项目了。

I was able to convert this to a VS2012 project, too.

这篇关于有没有办公室的.NET 4兼容的版本外接沉?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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