用于EW4的VB.NET COM加载项 [英] VB.NET COM Add-in for EW4
问题描述
这是一个基本的结构化VB.NET COM加载项,我们一直试图在WebEX4中工作,但它不起作用。 尝试了一些你可以看到注释掉的东西。 下到一个非常普通的com加载项,它也无法正常工作。 错误
是:
[12:02:21 PM]错误:无法从程序集'MyXWebAddIn,Version = 1.0加载类型'Expression_Web_4_AddIn.Connect'。 0.0,Culture = neutral,PublicKeyToken = null'。
这是我们的addins.xml加载语句
< load type =" Expression_Web_4_AddIn.Connect,MyXWebAddIn"命名= QUOT;东西" />
任何机构都有任何想法吗? 在这方面没有任何资源的垃圾邮件,一些主要由Microsoft团队成员构建的插件以及那些在Expression Web Team中直接联系的插件。
这将是一个很好的存根vb类,如果它工作可以分发,它将允许许多其他VB程序员在那里创建加载项。 它应该已经在SDK中,并且通过在此处发布代码,我们完成了大部分工作。
我们只需要知道我们有什么错误让它无法运行...然后我们将其打包,记录,然后发布。
我们很乐意将完成的代码发布为图库加载项,或者论坛中的解决方案可能会为大多数开发人员提供帮助。 必须有人对此有一定的了解。
{相信我,如果有更高级的论坛或资源,我们会去找它}
{我们有太多的遗留代码可以立即使用我们的J-script API ... 我们将很乐意为此努力,但需要几次互动才能到达那里。 这是代码:
#Region " Imports"
进口系统
进口系统.Diagnostics
Imports System.Runtime.InteropServices
Imports System.Windows
进口可扩展性
导入 Microsoft.Expression.Web
Imports Microsoft.Expression.Framework
Imports Microsoft.Expression.Web.Interop
Imports Microsoft.Expression.Web .Interop.Designer
Imports Microsoft.Expression.Web.Interop.Legacy
进口 stdole
#End Region
命名空间 Expression_Web_4_AddIn
#Region "阅读我的加载项安装和设置信息"
'http://www.squidoo.com/access-shared-add-in
'http://blogs.msdn.com/b/jdixon/archive/2010/08.aspx
'运行时,准备好了加载项向导加载项的注册表。
'稍后时间,如果加载项由于以下原因而变得不可用:
'1)你移动了这个投影到最初在其上创建的计算机上。
'2)您选择了"是" '当出现询问您是否要删除加载项的消息时。
'3)注册表损坏。
'您需要通过构建FPExtensionManagedSetup项目来重新注册加载项,
'在解决方案资源管理器中右键单击项目,然后选择安装。
#End Region
< ComVisible( True )>
< GuidAttribute(" ED75FC20-B6F0-4065-ABCB-878576B43BC7" ),_
ProgIdAttribute(" Expression_Web_4_AddIn.Connect" )> _
公共 类连接
#Region "从xWeb调用AddIn"
实现可扩展性.IDTExtensibility2
'Private WithEvents MyApp As Microsoft .Expression.Web.Interop.Application
私有 WithEvents ewApp As XWebApplication
'私有applicationObject As Application
私人 addInInstance 作为 对象
公共 Sub OnBeginShutdown(_
ByRef 自定义 As System.Array)_
< span style ="color:blue"> Implements Extensibility.IDTExtensibility2.OnBeginShutdown
'基本可扩展性功能
结束 Sub
公共 Sub OnAddInsUpdate(_
ByRef custom As System.Array)_
Implements Extensibility.IDTExtensibility2 .OnAddInsUpdate
'基本可扩展性功能
End Sub
公共 Sub OnStartupComplete(_
ByRef 自定义 As System.Array)_
Implements Extensibility.IDTExtensibility2.OnStartupComplete
'基本可扩展性功能
结束 Sub
公共 Sub OnDisconnection(_
ByVal RemoveMode As Extensibility.ext_DisconnectMode,_
ByRef 自定义As System.Array)_
Implements Extensibility.IDTExtensibility2.OnDisconnection
GC.Collect()
GC.WaitForPendingFinalizers()
'基本可扩展性功能
结束 Sub
公共 Sub OnConnection( ByVal 应用程序作为 对象, ByVal ConnectMode As Extensibility.ext_ConnectMode, ByVal AddInInst 作为 对象, ByRef [custom] 作为数组) Implements Extensibility.IDTExtensibility2.OnConnection
'基本可扩展性函数
'这是您可以编写的最简单的OnConnection例程
结束 Sub
'Public Sub OnConnection(_
'ByVal应用程序As Object,_
'ByVal connectMode As Extensibility.ext_ConnectMode, _
'ByVal addInInst As Object,ByRef custom As System.Array)_
'Implements Extensibility.IDTExtensibility2.OnConnection
''MyApp = CType(application,Microsoft.Expression.Web.Interop.Application)
'ewApp = CType(应用程序,XWebApplication)
''Dim ewApp作为新的XWebApplication( )
'addInInstance = addInInst
'addInInstance.Object = Me
''System.Windows.Forms.MessageBox.Show(" Expression Web" &安培; ewApp.Version)
''System.Windows.Forms.MessageBox.Show(" Expression Web" ;& MyApp.Version)
''MessageBox.Show(" Web Site Opened:" ;& pWeb.Url)
'结束次
#End Region
'Private Sub MyApp_OnPageOpen(ByVal pPage As Microsoft.Expression.Web.Interop .PageWindow)处理MyApp.OnPageOpen
'MessageBox.Show(" Web Page Opened:" & pPage.ActiveDocument.url)
'
'
'结束次
'基本可扩展性功能
公共 功能 TestFunction()正如 [ String ]
返回 " MyTestFunction"
结束 功能
结束 < span style ="color:blue"> Class
结束 命名空间
您从哪种服务器运行它?
假设IIS,您是否已将该站点的根文件夹设置为Appl IIS中的根源?
Here is a basic structured VB.NET COM Add-in that we have been trying to get to work in WebEX4 and it won't work. Tried a number of things which you can see commented out. Down to a very vanilla com add-in and it too won't work. The error is:
[12:02:21 PM] Error: Could not load type 'Expression_Web_4_AddIn.Connect' from assembly 'MyXWebAddIn, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
This is our addins.xml load statement
<load type="Expression_Web_4_AddIn.Connect, MyXWebAddIn" name="stuff" />
Any body have any ideas?? There are litterly zip to no resources on this, a handful of add-ins built mostly by Microsoft team members and those that have been privy to direct contact within the Expression Web Team.
This would be a nice stub vb class that could be distributed if it worked and it would allow many other VB programmers out there to create add-ins. It should already be in the SDK and by posting the code here, we have done a large percentage of the work.
We just need to know what mistake we have that is keeping it from working...then we will package it up, document it, and post it.
We would be happy to post the finished code as a gallery add-in or a solution here in the forum would probably do the trick for most developers. There has to be someone out there that has some knowledge on this.
{Trust me, if there was a more advanced forum or resource, we'd go to it}
{We have too much legacy code to go immediately from what we have to the J-script API... We will be happy to work towards that, but it will take a couple of interations to get there. }
Here is the code:
#Region "Imports" Imports System Imports System.Diagnostics Imports System.Runtime.InteropServices Imports System.Windows Imports Extensibility Imports Microsoft.Expression.Web Imports Microsoft.Expression.Framework Imports Microsoft.Expression.Web.Interop Imports Microsoft.Expression.Web.Interop.Designer Imports Microsoft.Expression.Web.Interop.Legacy Imports stdole #End Region Namespace Expression_Web_4_AddIn #Region "Read me for Add-in installation and setup information" ' http://www.squidoo.com/access-shared-add-in ' http://blogs.msdn.com/b/jdixon/archive/2010/08.aspx 'When run, the Add-in wizard prepared the registry for the Add-in. 'At a later time, if the Add-in becomes unavailable for reasons such as: ' 1) You moved this project to a computer other than which is was originally created on. ' 2) You chose 'Yes' when presented with a message asking if you wish to remove the Add-in. ' 3) Registry corruption. 'you will need to re-register the Add-in by building the FPExtensionManagedSetup project, 'right click the project in the Solution Explorer, then choose install. #End Region <ComVisible(True)> <GuidAttribute("ED75FC20-B6F0-4065-ABCB-878576B43BC7"), _ ProgIdAttribute("Expression_Web_4_AddIn.Connect")> _ Public Class Connect #Region "AddIn called from xWeb" Implements Extensibility.IDTExtensibility2 'Private WithEvents MyApp As Microsoft.Expression.Web.Interop.Application Private WithEvents ewApp As XWebApplication ' Private applicationObject As Application Private addInInstance As Object Public Sub OnBeginShutdown( _ ByRef custom As System.Array) _ Implements Extensibility.IDTExtensibility2.OnBeginShutdown 'Basic Extensibility Function End Sub Public Sub OnAddInsUpdate( _ ByRef custom As System.Array) _ Implements Extensibility.IDTExtensibility2.OnAddInsUpdate 'Basic Extensibility Function End Sub Public Sub OnStartupComplete( _ ByRef custom As System.Array) _ Implements Extensibility.IDTExtensibility2.OnStartupComplete 'Basic Extensibility Function End Sub Public Sub OnDisconnection( _ ByVal RemoveMode As Extensibility.ext_DisconnectMode, _ ByRef custom As System.Array) _ Implements Extensibility.IDTExtensibility2.OnDisconnection GC.Collect() GC.WaitForPendingFinalizers() 'Basic Extensibility Function End Sub Public Sub OnConnection(ByVal Application As Object, ByVal ConnectMode As Extensibility.ext_ConnectMode, ByVal AddInInst As Object, ByRef [custom] As Array) Implements Extensibility.IDTExtensibility2.OnConnection 'Basic Extensibility Function 'This is the simplest OnConnection routine that you can write End Sub ' Public Sub OnConnection( _ ' ByVal application As Object, _ ' ByVal connectMode As Extensibility.ext_ConnectMode, _ ' ByVal addInInst As Object, ByRef custom As System.Array) _ ' Implements Extensibility.IDTExtensibility2.OnConnection ' 'MyApp = CType(application, Microsoft.Expression.Web.Interop.Application) ' ewApp = CType(application, XWebApplication) ' 'Dim ewApp As New XWebApplication() ' addInInstance = addInInst ' addInInstance.Object = Me ' ' System.Windows.Forms.MessageBox.Show("Expression Web " & ewApp.Version) ' 'System.Windows.Forms.MessageBox.Show("Expression Web" & MyApp.Version) ' 'MessageBox.Show("Web Site Opened: " & pWeb.Url) ' End Sub #End Region ' Private Sub MyApp_OnPageOpen(ByVal pPage As Microsoft.Expression.Web.Interop.PageWindow) Handles MyApp.OnPageOpen ' MessageBox.Show("Web Page Opened: " & pPage.ActiveDocument.url) ' ' ' End Sub 'Basic Extensibility Function Public Function TestFunction() As [String] Return "MyTestFunction" End Function End Class End Namespace
What Kind of server are you running it from?
Assuming IIS, have you set the root folder for the site as the Application Root in IIS?
这篇关于用于EW4的VB.NET COM加载项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!