473,326 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Signed assembly not recognised by VB6

Hello group,

I'm facing a problem in calling a signed .Net class library (c#) from
VB6 exe.

I have a VB6 exe calling .net assembly. The call to .Net dll works fine
when i deploy the .Net assembly as Private assembly. But here the only
issue is i need to place .Net dll and VB6 exe in same location.

To avoid this location dependency issue i tried registering the .Net
dll in GAC (signed with key pair). Now, when i call the .Net assembly
from VB6 it doesn't seem to be recognised by VB6. The code in VB6
doesn't throw any error, but the function in assembly is not getting
called.

Please suggest.

-Cheers

Jul 10 '06 #1
3 1800
Pranesh,

I would go with a greenfield approach. Basically, remove the assembly
from the GAC, and unregister the assembly (regasm). Also, remove the
reference from your VB project and shut VB6 down.

Then, put the assembly in the GAC, register it with REGASM, and then
open up VB and find the reference to make to your project.

Are you setting the GUID in your code for your interfaces and for your
classes that are being used in VB (you should be exposing interfaces that
are visible to COM and not the class itself).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<pr***********@gmail.comwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
Hello group,

I'm facing a problem in calling a signed .Net class library (c#) from
VB6 exe.

I have a VB6 exe calling .net assembly. The call to .Net dll works fine
when i deploy the .Net assembly as Private assembly. But here the only
issue is i need to place .Net dll and VB6 exe in same location.

To avoid this location dependency issue i tried registering the .Net
dll in GAC (signed with key pair). Now, when i call the .Net assembly
from VB6 it doesn't seem to be recognised by VB6. The code in VB6
doesn't throw any error, but the function in assembly is not getting
called.

Please suggest.

-Cheers

Jul 10 '06 #2
Thanks for your reply Nicholas !!!

I have already tried the greenfield approach without any success.

Below is my interface defn. Is setting GUID compulsary?. If yes thn how
can i genarate those GUID's?

[InterfaceType(ComInterfaceType.InterfaceIsIDispatc h)]
public interface myInterface
{
Boolean myMethod(String ..., Int32 ...);
}

[ComSourceInterfaces("myCOM.MyInterface")]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("myCOM.myClass")]
public class myClass : myInterface{}

- cheers
Nicholas Paldino [.NET/C# MVP] wrote:
Pranesh,

I would go with a greenfield approach. Basically, remove the assembly
from the GAC, and unregister the assembly (regasm). Also, remove the
reference from your VB project and shut VB6 down.

Then, put the assembly in the GAC, register it with REGASM, and then
open up VB and find the reference to make to your project.

Are you setting the GUID in your code for your interfaces and for your
classes that are being used in VB (you should be exposing interfaces that
are visible to COM and not the class itself).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<pr***********@gmail.comwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
Hello group,

I'm facing a problem in calling a signed .Net class library (c#) from
VB6 exe.

I have a VB6 exe calling .net assembly. The call to .Net dll works fine
when i deploy the .Net assembly as Private assembly. But here the only
issue is i need to place .Net dll and VB6 exe in same location.

To avoid this location dependency issue i tried registering the .Net
dll in GAC (signed with key pair). Now, when i call the .Net assembly
from VB6 it doesn't seem to be recognised by VB6. The code in VB6
doesn't throw any error, but the function in assembly is not getting
called.

Please suggest.

-Cheers
Jul 11 '06 #3
FYI:
i foundout how to create GUID, Please let me know whether it is
compulsary to set GUID to make my code work?.

pr***********@gmail.com wrote:
Thanks for your reply Nicholas !!!

I have already tried the greenfield approach without any success.

Below is my interface defn. Is setting GUID compulsary?. If yes thn how
can i genarate those GUID's?

[InterfaceType(ComInterfaceType.InterfaceIsIDispatc h)]
public interface myInterface
{
Boolean myMethod(String ..., Int32 ...);
}

[ComSourceInterfaces("myCOM.MyInterface")]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("myCOM.myClass")]
public class myClass : myInterface{}

- cheers
Nicholas Paldino [.NET/C# MVP] wrote:
Pranesh,

I would go with a greenfield approach. Basically, remove the assembly
from the GAC, and unregister the assembly (regasm). Also, remove the
reference from your VB project and shut VB6 down.

Then, put the assembly in the GAC, register it with REGASM, and then
open up VB and find the reference to make to your project.

Are you setting the GUID in your code for your interfaces and for your
classes that are being used in VB (you should be exposing interfaces that
are visible to COM and not the class itself).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<pr***********@gmail.comwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
Hello group,
>
I'm facing a problem in calling a signed .Net class library (c#) from
VB6 exe.
>
I have a VB6 exe calling .net assembly. The call to .Net dll works fine
when i deploy the .Net assembly as Private assembly. But here the only
issue is i need to place .Net dll and VB6 exe in same location.
>
To avoid this location dependency issue i tried registering the .Net
dll in GAC (signed with key pair). Now, when i call the .Net assembly
from VB6 it doesn't seem to be recognised by VB6. The code in VB6
doesn't throw any error, but the function in assembly is not getting
called.
>
Please suggest.
>
-Cheers
>
Jul 11 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John | last post by:
Hi, I am building an application that uses Steema's TeeChart. When I run my app through the dotfuscator it breaks the executable (saying something about not finding the strongly named TeeChart...
2
by: Bob Rock | last post by:
Hello, is it possible to programmatically read (and how) the public key that is embedded into an assembly that has been strongly signed??? What code would be needed??? Bob Rock
3
by: wschaub | last post by:
We need to inject information (i.e. server details from where a signed file was downloaded) into a signed file, without breaking the signature or integrity of a signed file. Apparently there are...
3
by: candy_init | last post by:
hi I recently came across a C program, a snippet of which is as follows: unsigned long get_sp(void) { __asm__("movl %esp,%eax"); } int main(int argc,char **argv) {
1
by: R. Ian Lee | last post by:
I'm building a "plugin" architecture into my application where it will automatically detect (through Reflection) assemblies that are dropped into a folder as plugins and execute them when necessary. ...
2
by: cs | last post by:
is there a way to check trhough c# code if an assembly is signed and if it has the same signature as another assembly? I have some code that uses reflection on some types that belong to some...
0
by: Nikhil Patel | last post by:
Hi all, I have written a C# Class Library project which generates a signed assembly. When I build this project, it basically creates a dll and a tlb file. Now I am creating a Setup and Deployment...
0
by: Andy | last post by:
Hi all, I have a few questions about restricting who may call an assembly i'm building. First, I have a business assembly on a web server, with Serializable objects that use remoting to move...
0
by: savajx1 | last post by:
I am loading signed assemblies from a network share. The assemblies are NOT INSTALLED in the GAC as they are part of an enterprise distributed application implemented as a windows service that...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.