Can't seem to register my C# dll

G

Guest

Hi there,

I have created class library project called DSResolver in an attempt to create a SQL server Custom Conflict Resolver dll. My project contains on class called DataSafeResolve which implements the SQLResolver.IVBCustomRsolver interface. The project also has a reference to the SQLResolver dll. I compiled the project into a dll and I tried to register it. I got the following error message:
"DSResolver.dll was loaded, but the DllRegisterServer or DllUnregisterServer entry point was not found."

I went to the project properties and under configuration Properties|Build|Outputs, I set Register for COM Interop to true thinking that could help, but it didn't. If you have an idea of what I'm doing wrong, please let me know. Below is a short version of the class.

using System;
using System.Text;
using System.IO;


namespace DSResolver
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class DataSafeResolver : SQLResolver.IVBCustomResolver
{
int OSQL_SYSNAME_SET = 128;

public DataSafeResolver()
{
//
// TODO: Add constructor logic here
//
}

//Implement the two methods in ICustomResolver
/// <summary>
/// Returns the conflict types that should be handled. Only update coflicts are handled here
/// </summary>
/// <param name="ChangeType"></param>
void SQLResolver.ICustomResolver.GetHandledStates(ref int ChangeType)
{
SQLResolver.REPOLE_CHANGE_TYPE rct;

rct = SQLResolver.REPOLE_CHANGE_TYPE.REPOLEChange_SubscriberUpdate_ConflictColTrack |
SQLResolver.REPOLE_CHANGE_TYPE.REPOLEChange_SubscriberUpdate_ConflictNoColTrack |
SQLResolver.REPOLE_CHANGE_TYPE.REPOLEChange_PublisherUpdate_ConflictColTrack |
SQLResolver.REPOLE_CHANGE_TYPE.REPOLEChange_PublisherUpdate_ConflictNoColTrack;
ChangeType = (int) rct;

}

/// <summary>
/// This method in ivoked by the merge process whenever a conflict
/// defined in ICustomResolver.GetHandledStates occurs
/// </summary>
/// <param name="rrc"></param>
/// <param name="dwFlags"></param>
/// <param name="rrcSugg"></param>
void SQLResolver.ICustomResolver.Reconcile(SQLResolver.IReplRowChange rrc, int dwFlags, SQLResolver.IReplRowChange rrcSugg)
{

//Some resolver code

}
catch(Exception e)
{
throw (e);
}
}


}
}
 
G

Guest

Danny,
It sounds like you are running regsvr32.exe on your dll to register it as a com component. For .Net components, you should run regasm instead which registers .Net as your server which acts as shim.

Hope that helps

Jackson Davis [MSFT]
 
F

Frank Oquendo

Danny said:
I went to the project properties and under configuration
Properties|Build|Outputs, I set Register for COM Interop to true
thinking that could help, but it didn't. If you have an idea of what
I'm doing wrong, please let me know.

I noticed none of your code was decorated with attributes. Have a look at
ComVisible, Guid, ProgId and InterfaceType. The combination of those four
along with the COM Interop registration option should do the trick.

Also, unless something is meant to be a COM server, decorate it with
[ComVisible(false)].

--
There are 10 kinds of people. Those who understand binary and those who
don't.

http://code.acadx.com
(Pull the pin to reply)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top