You need to create a COM callable wrapper for your .net assembly to
make it appear in COM References in Navision. Here are the steps:
1. Add the following attributes to your classes
[Guid("use GUIDGen.exe to create GUID for urself")]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("MyApp.MyClass")]
Each class should have a unique GUID, and ProdID
2. Make your classes implmenent interfaces. (Not strictly required but
is good practice to make sure that COM callable wrappers work without
hitches). Example below:
[Guid(...)]
[InterfaceType.ComInterfaceType.InterfaceIsIDispatc h)]
public interface MyInterface
{
//Method definitions go here...
}
[Guid(...)]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("MyApplication.MyClass")]
public class MyClass : MyInterface
{
//Interface implementation goes here...
}
3. If you are using VS.Net then do the following or goto step 4:
In project properties set the properties Register for Com Interop
to true. Now when you build the project, a COM Wrapper will be created
and registered. It should show up in COM References tab
4. Use regasm to register the ccw (com callable wrapper) of the
assembly. Optionally use the /tlb: switch to generate a type library
for the .net assembly.
After these steps you should be good to go... For more information
check the following links:
http://msdn.microsoft.com/library/de...blewrapper.asp
- CCW MSDN Docs
http://weblogs.asp.net/psteele/archi...16/157767.aspx - RegAsm
and COM
Hope this helps...
- NuTcAsE