EDN Admin
Well-known member
I am developing a .NET assembly that Id 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 <font color="#0000ff The assembly "c:sgmeteorbinCTY.SchedulingTool.dll" could not be converted to a type library. Type library exporter encountered an error while processing CTY.SchedulingTool.ComEntry, CTY.SchedulingTool. <font style="background-color:#ffff00 Error: Element not found</font></font>
<font color="#000000 Here is the C# code - </font> <font color="#0000ff" size=2>
using</font><font size=2> System;</font>
<font color="#0000ff" size=2>using</font><font size=2> System.Collections.Generic; </font><font color="#0000ff" size=2>
using</font><font size=2> System.Text; </font><font color="#0000ff" size=2>
using</font><font size=2> System.Runtime.InteropServices;
</font><font color="#0000ff" size=2>
namespace</font><font size=2> CTY.SchedulingTool
{
[</font><font color="#2b91af" size=2>GuidAttribute</font><font size=2>(</font><font color="#a31515" size=2>"443b6599-c884-407c-aa98-0cd469f4ca2d"</font><font size=2>)]
[</font><font color="#2b91af" size=2>ClassInterface</font><font size=2>(</font><font color="#2b91af" size=2>ClassInterfaceType</font><font size=2>.AutoDual)]
</font><font color="#0000ff" size=2> public</font><font size=2> </font><font color="#0000ff" size=2>class</font><font size=2> </font><font color="#2b91af" size=2>ComEntry </font><font size=2>
{
</font><font color="#0000ff" size=2> private</font><font size=2> </font><font color="#2b91af" size=2>MainForm</font><font size=2> myForm;
</font><font color="#0000ff" size=2> public</font><font size=2> ComEntry()
{
myForm = </font><font color="#0000ff" size=2>new</font><font size=2> </font><font color="#2b91af" size=2>MainForm</font><font size=2>();
}
</font><font color="#0000ff" size=2> public</font><font size=2> </font><font color="#0000ff" size=2>void</font><font size=2> ShowForm()
{
myForm.Show();
}
}
}
Any ideas why I am getting the error while building? </font>
View the full article
<font color="#000000 Here is the C# code - </font> <font color="#0000ff" size=2>
using</font><font size=2> System;</font>
<font color="#0000ff" size=2>using</font><font size=2> System.Collections.Generic; </font><font color="#0000ff" size=2>
using</font><font size=2> System.Text; </font><font color="#0000ff" size=2>
using</font><font size=2> System.Runtime.InteropServices;
</font><font color="#0000ff" size=2>
namespace</font><font size=2> CTY.SchedulingTool
{
[</font><font color="#2b91af" size=2>GuidAttribute</font><font size=2>(</font><font color="#a31515" size=2>"443b6599-c884-407c-aa98-0cd469f4ca2d"</font><font size=2>)]
[</font><font color="#2b91af" size=2>ClassInterface</font><font size=2>(</font><font color="#2b91af" size=2>ClassInterfaceType</font><font size=2>.AutoDual)]
</font><font color="#0000ff" size=2> public</font><font size=2> </font><font color="#0000ff" size=2>class</font><font size=2> </font><font color="#2b91af" size=2>ComEntry </font><font size=2>
{
</font><font color="#0000ff" size=2> private</font><font size=2> </font><font color="#2b91af" size=2>MainForm</font><font size=2> myForm;
</font><font color="#0000ff" size=2> public</font><font size=2> ComEntry()
{
myForm = </font><font color="#0000ff" size=2>new</font><font size=2> </font><font color="#2b91af" size=2>MainForm</font><font size=2>();
}
</font><font color="#0000ff" size=2> public</font><font size=2> </font><font color="#0000ff" size=2>void</font><font size=2> ShowForm()
{
myForm.Show();
}
}
}
Any ideas why I am getting the error while building? </font>
View the full article