Error : there are no registrable types in the built assembly

  • Thread starter Thread starter Prigozhin Roman
  • Start date Start date
P

Prigozhin Roman

I'm trying to create a com object, code looks fine for me ( like other com
objects I've created )
but this time I'm getting error : "There are no registrable types in the
built assembly"
Anyone knows how to fix it ?

About my object :
+ In project options I have option "Register for COM Interop" checked
+ In my COM Object I'm referencing other C# dll which are not signed (
without strong names )
+ My COM object is not signed

Here you can see some code :

using System.Runtime.InteropServices;

using System;

using System.Data;

using System.Data.OleDb;

using System.IO;

using System.Text;

using OCSClassLibraries.VopUtilities;

using OCSClassLibraries.FileUtilities;





namespace OCS_BlueContactlessPass2_COM

{


[Guid("15D1806A-B83C-4d74-806C-28E9FF647E9A")]

public interface InputFileGenerator_Interface

{

bool GenerateJobFile(char batchCode, out string error);

}


// Events interface

[Guid("6CF790ED-203C-4a06-A1E7-C0F539E2846F"),

InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]

public interface InputFileGenerator_Events

{

}


[Guid("E6AE937D-DEC8-4b15-B6E2-D354B93E16FD"),

ClassInterface(ClassInterfaceType.None),

ComSourceInterfaces(typeof(InputFileGenerator_Events))]

public class InputFileGenerator : InputFileGenerator_Interface

{

string wipFile;

string inputFileDir; // input JVD file for VOP1015


public InputFileGenerator(string wipFileName, string inputFileDir)

{

this.wipFile = wipFileName;

this.inputFileDir = inputFileDir;

}



........................ etc


Thanks,
Roman Prigozhin
 
Hi,

Ensure you don't have [assembly:ComVisible(false)] in AssemblyInfo.cs.
 
I've checked this, and I don't have this line in my AssemblyINfo.cs file.
These are the only parameters I have in the file.
[assembly: AssemblyTitle("")]

[assembly: AssemblyDescription("")]

[assembly: AssemblyConfiguration("")]

[assembly: AssemblyCompany("")]

[assembly: AssemblyProduct("")]

[assembly: AssemblyCopyright("")]

[assembly: AssemblyTrademark("")]

[assembly: AssemblyCulture("")]

[assembly: AssemblyDelaySign(false)]

[assembly: AssemblyKeyFile("")]

[assembly: AssemblyKeyName("")]


Dmitriy Lapshin said:
Hi,

Ensure you don't have [assembly:ComVisible(false)] in AssemblyInfo.cs.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

Prigozhin Roman said:
I'm trying to create a com object, code looks fine for me ( like other com
objects I've created )
but this time I'm getting error : "There are no registrable types in the
built assembly"
Anyone knows how to fix it ?
 
Error was finaly found, the problem is in overloaded constructor.
[Guid("15D1806A-B83C-4d74-806C-28E9FF647E9A")]

public interface InputFileGenerator_Interface

{

bool GenerateJobFile(char batchCode, out string error);

}


// Events interface

[Guid("6CF790ED-203C-4a06-A1E7-C0F539E2846F"),

InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]

public interface InputFileGenerator_Events

{

}


[Guid("E6AE937D-DEC8-4b15-B6E2-D354B93E16FD"),

ClassInterface(ClassInterfaceType.None),

ComSourceInterfaces(typeof(InputFileGenerator_Events))]

public class InputFileGenerator : InputFileGenerator_Interface

{

private string wipFile;

private string inputFileDir; // input JVD file for VOP1015


public InputFileGenerator(string wipFileName, string inputFileDir) <----
this is the error

{

this.wipFile = wipFileName;

this.inputFileDir = inputFileDir;

}

....... etc
 
What's strange still is that the compiler (or the COM registration tool)
hasn't complained about parameterized constructors at all. These are
incompatible with COM by definition, so I'd expect at least a warning
message to be issued.

The actual error produced, obviously, is loosely related to the problem.
 
Back
Top