Using .Net from VB6 - looking in wrong folder

Using .Net from VB6 - looking in wrong folder

Post by Marin » Wed, 12 Feb 2003 00:27:41



Hi,

I have a .NET assembly that needs to be used by VB6. Using regasm /tlb
registers it. However, when running the code, the .NET dll cannot be found.
If I put it in the GAC - then of course it finds it. However, I want to know
why it doesn't.

Using filemon, it seems that the runtime is trying to find the assembly in
the system32 folder - not the folder where it was registered from. This
seems to be the problem - and of course putting it in the GAC, places it in
a known location where it can be found. How can this default behavior of
looking in system32 be changed so the GAC can be avoided?

Thanks

 
 
 

Using .Net from VB6 - looking in wrong folder

Post by David Stucki [M » Wed, 12 Feb 2003 03:10:01


You can put the file in the same folder as the EXE is running in, in the
GAC, or use regasm.exe with the /codebase switch.

David Stucki
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.

 
 
 

Using .Net from VB6 - looking in wrong folder

Post by Marin » Wed, 12 Feb 2003 03:24:33


This file is being executed by another DLL, not an exe. Putting it in the
same directory does not help, using filemon shows the runtime is looking for
the file in system32.

The GAC is what I was trying to avoid.

I think the codebase option is the way to go - didn't see it before. Thanks!



Quote:> You can put the file in the same folder as the EXE is running in, in the
> GAC, or use regasm.exe with the /codebase switch.

> David Stucki
> Microsoft Developer Support

> This posting is provided "AS IS" with no warranties, and confers no
rights.

 
 
 

Using .Net from VB6 - looking in wrong folder

Post by Santhosh Pillai [MS » Wed, 12 Feb 2003 10:04:31


The file has to be in the same directory of the process that hosts it. If it
is executed by a DLL, then it has to be in the same directory of the EXE
that hosts the DLL. (This is the reason why you have to put the file in the
directory of VB.EXE when you debug the file from inside the VB IDE.)

As David pointed out, the better option would be to use /codebase, or put it
in the GAC.

Hope this helps.

Thanks,
Santhosh
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
?2002 Microsoft Corporation. All rights reserved.


> This file is being executed by another DLL, not an exe. Putting it in the
> same directory does not help, using filemon shows the runtime is looking
for
> the file in system32.

> The GAC is what I was trying to avoid.

> I think the codebase option is the way to go - didn't see it before.
Thanks!



> > You can put the file in the same folder as the EXE is running in, in the
> > GAC, or use regasm.exe with the /codebase switch.

> > David Stucki
> > Microsoft Developer Support

> > This posting is provided "AS IS" with no warranties, and confers no
> rights.

 
 
 

1. .NET Add-ins in Excel do not show up in Add-ins

Has anyone been successful in adding custom built-in functions into
Excel via the .net XP Interop assemblies?

According to MS KB 316723, you have to make sure you build the
deployment project for the Current User, not the machine.  I did that.

Also, in the Add-in path for Excel, I added a string called "Automation"
(from a support call to Microsoft) ... but
alas ... no add-in after I install.

Anyone get this to work?

--mike

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

2. NMEA Reader

3. .NET RC1 install fails: looking for /Binn folder?????

4. Milan

5. Multi-CheckOut with VSS add-ins in VB6

6. Tandy 100 or 200 wanted

7. 1.1 installed in wrong folder?

8. Generating Simple Sounds...

9. Unable To View .NET procedures with VB6 code complete or VB6 Object Browser

10. Visual Modeler looking at wrong SS default database

11. VSS - Traditional ASP dev using .Net studio and shadow folder problems

12. Why is ASP.NET looking in wrong class?

13. (DataGrid) Am I looking at this the wrong way?