转换为类型库时出错 [英] Error while converting to a type library

查看:47
本文介绍了转换为类型库时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个要向COM公开的.NET程序集.使用Visual Studio 2005,我创建了一个简单的.NET程序集.我已将COMVisible设置为true,并选中了注册COM互操作".在项目属性中.但是,我收到一个生成错误程序集"c:\ sg \ meteor \ bin \ CTY.SchedulingTool.dll",无法转换为类型库.类型库导出程序在处理'CTY.SchedulingTool.ComEntry,CTY.SchedulingTool'时遇到错误. 错误:找不到元素

这是C#代码-

使用 系统;

使用 System.Collections.Generic;

使用 System.Text;

使用 System.Runtime.InteropServices;

命名空间 CTY.SchedulingTool

{

[ GuidAttribute ( " 443b6599-c884-407c-aa98-0cd469f4ca2d; )]

[ ClassInterface ( ClassInterfaceType .AutoDual)]

\ public class > ComEntry

{

私有 MainForm myForm;

公共 ComEntry()

{{p

myForm = MainForm ();

}

public void ShowForm()

.{

myForm.Show();

}

}

}

有什么想法为什么我在构建时遇到错误?

解决方案

不,对不起,但是我也可以在理解此错误的同时提供一些帮助.


I am developing a .NET assembly that I'd like to expose to COM. Using Visual Studio 2005, I have create a simple .NET assembly. I have set COMVisible to true and checked "Register for COM interop" in the project properties. However, I get a build error The assembly "c:\sg\meteor\bin\CTY.SchedulingTool.dll" could not be converted to a type library. Type library exporter encountered an error while processing 'CTY.SchedulingTool.ComEntry, CTY.SchedulingTool'. Error: Element not found

Here is the C# code  -

using System;

using System.Collections.Generic;

using System.Text;

using System.Runtime.InteropServices;

 

namespace CTY.SchedulingTool

{

[GuidAttribute("443b6599-c884-407c-aa98-0cd469f4ca2d")]

[ClassInterface(ClassInterfaceType.AutoDual)]

  public class ComEntry

  {

       private MainForm myForm;

      public ComEntry()

     {

           myForm = new MainForm();

     }

     public void ShowForm()

    {

          myForm.Show();

    }

  }

}

 

Any ideas why I am getting the error while building?

解决方案

No, sorry but i could do with a little help understanding this error as well.


这篇关于转换为类型库时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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