问题描述
我正在开发一个要向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?
这篇关于转换为类型库时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!