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.

Multiple referenced dlls

Jan
We have a VB dll that invokes a C# dll. The C# dll references 3 other dlls -
one is a .NET dll, the other two are win32 COM dlls. I have a script that
invokes the VB dll which in turn successfully invokes the C# dll on my
development machine.

Next, I tried deploying to a stage server, but couldn't get the same test to
work there. It seems the C# dll is not being invoked. I moved the C# dll
and it's referenced .net and Interop dlls. I registered all 4 dlls using:
regasm mymain.dll
regasm mydotnet.dll
regasm Interop.First.dll
regasm Interop.Second.dll

I tried signing all the dlls:
sn -k myMain.dll (repeat for others)

Then tried gacutil for each dll, but get an error saying they cannot be
added to the GAC because they are not strongly named, even after using sn.exe.

I'm new to .NET - can anyone recommend the proper steps. I must be missing
something between the environments (I am thinking Visual Studio does some
registration for me that isn't happening on the stage machine?).

Thanks,
Jan
Nov 16 '05 #1
8 1395
Jan,

You said you can't get it to work there. What is the error that you are
getting?

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

"Jan" <Ja*@discussions.microsoft.com> wrote in message
news:BE**********************************@microsof t.com...
We have a VB dll that invokes a C# dll. The C# dll references 3 other
dlls -
one is a .NET dll, the other two are win32 COM dlls. I have a script that
invokes the VB dll which in turn successfully invokes the C# dll on my
development machine.

Next, I tried deploying to a stage server, but couldn't get the same test
to
work there. It seems the C# dll is not being invoked. I moved the C# dll
and it's referenced .net and Interop dlls. I registered all 4 dlls using:
regasm mymain.dll
regasm mydotnet.dll
regasm Interop.First.dll
regasm Interop.Second.dll

I tried signing all the dlls:
sn -k myMain.dll (repeat for others)

Then tried gacutil for each dll, but get an error saying they cannot be
added to the GAC because they are not strongly named, even after using
sn.exe.

I'm new to .NET - can anyone recommend the proper steps. I must be
missing
something between the environments (I am thinking Visual Studio does some
registration for me that isn't happening on the stage machine?).

Thanks,
Jan

Nov 16 '05 #2
First of all, if you're new to .NET, I recommend that you _stay away_
from strong naming and the GAC for now. I've been working with .NET for
a year now, and strong naming and the GAC are still too complicated for
my little brain, although I'm reading up on .NET Framework Security
(and it's still too complicated).

If you're developing and deploying applications in-house, just stick
with private assemblies. The only catch is that all of the DLLs have to
be in the same directory with your application. However, I think that
that's a small price to pay for not having to deal with the intricacies
of the GAC.

Get rid of the files created by sn in your project directory, and make
sure that none of your DLLs are strong-named. Then build them all and
put them in the same directory. If you still can't get it to work, post
the error message here, and give more details about what assembly calls
what other assemblies, and which assemblies are .NET and which are not,
and which you wrote and compiled and which you didn't.

Nov 16 '05 #3
Jan
Well, that is the thing- I don't get an error- the C# dll is just not being
invoked. To test it, I had each dll return a simple string so I would know
which dlls had been invoked. On the stage box, I get the string back from
the vb dll, but not the C# dll. On my dev box, I get both strings back.

Any ideas?

Much obliged,
Jan

"Nicholas Paldino [.NET/C# MVP]" wrote:
Jan,

You said you can't get it to work there. What is the error that you are
getting?

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

"Jan" <Ja*@discussions.microsoft.com> wrote in message
news:BE**********************************@microsof t.com...
We have a VB dll that invokes a C# dll. The C# dll references 3 other
dlls -
one is a .NET dll, the other two are win32 COM dlls. I have a script that
invokes the VB dll which in turn successfully invokes the C# dll on my
development machine.

Next, I tried deploying to a stage server, but couldn't get the same test
to
work there. It seems the C# dll is not being invoked. I moved the C# dll
and it's referenced .net and Interop dlls. I registered all 4 dlls using:
regasm mymain.dll
regasm mydotnet.dll
regasm Interop.First.dll
regasm Interop.Second.dll

I tried signing all the dlls:
sn -k myMain.dll (repeat for others)

Then tried gacutil for each dll, but get an error saying they cannot be
added to the GAC because they are not strongly named, even after using
sn.exe.

I'm new to .NET - can anyone recommend the proper steps. I must be
missing
something between the environments (I am thinking Visual Studio does some
registration for me that isn't happening on the stage machine?).

Thanks,
Jan


Nov 16 '05 #4
Are you sure your code is not swallowing the exception? Code just
doesn't get ignored. Is this code in an event handler of some sort?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jan" <Ja*@discussions.microsoft.com> wrote in message
news:73**********************************@microsof t.com...
Well, that is the thing- I don't get an error- the C# dll is just not
being
invoked. To test it, I had each dll return a simple string so I would
know
which dlls had been invoked. On the stage box, I get the string back from
the vb dll, but not the C# dll. On my dev box, I get both strings back.

Any ideas?

Much obliged,
Jan

"Nicholas Paldino [.NET/C# MVP]" wrote:
Jan,

You said you can't get it to work there. What is the error that you
are
getting?

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

"Jan" <Ja*@discussions.microsoft.com> wrote in message
news:BE**********************************@microsof t.com...
> We have a VB dll that invokes a C# dll. The C# dll references 3 other
> dlls -
> one is a .NET dll, the other two are win32 COM dlls. I have a script
> that
> invokes the VB dll which in turn successfully invokes the C# dll on my
> development machine.
>
> Next, I tried deploying to a stage server, but couldn't get the same
> test
> to
> work there. It seems the C# dll is not being invoked. I moved the C#
> dll
> and it's referenced .net and Interop dlls. I registered all 4 dlls
> using:
> regasm mymain.dll
> regasm mydotnet.dll
> regasm Interop.First.dll
> regasm Interop.Second.dll
>
> I tried signing all the dlls:
> sn -k myMain.dll (repeat for others)
>
> Then tried gacutil for each dll, but get an error saying they cannot be
> added to the GAC because they are not strongly named, even after using
> sn.exe.
>
> I'm new to .NET - can anyone recommend the proper steps. I must be
> missing
> something between the environments (I am thinking Visual Studio does
> some
> registration for me that isn't happening on the stage machine?).
>
> Thanks,
> Jan
>
>


Nov 16 '05 #5
Jan
Yeah, I thought of that too, so tried returning the exception message and
still nothing. Here is what the public method in the C# dll looks like:

public string ProcessMyMessage(string sMessage)
{
string sResult = string.Empty;
try
{
sResult = "AIC Appraisal successfully invoked. This is a test to see if
C# dll will work.";
}
catch (Exception e)
{
sResult = "Exception occurred in CSharp dll. Message is: " + e.Message;
}
return sResult;
"Nicholas Paldino [.NET/C# MVP]" wrote:
Are you sure your code is not swallowing the exception? Code just
doesn't get ignored. Is this code in an event handler of some sort?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jan" <Ja*@discussions.microsoft.com> wrote in message
news:73**********************************@microsof t.com...
Well, that is the thing- I don't get an error- the C# dll is just not
being
invoked. To test it, I had each dll return a simple string so I would
know
which dlls had been invoked. On the stage box, I get the string back from
the vb dll, but not the C# dll. On my dev box, I get both strings back.

Any ideas?

Much obliged,
Jan

"Nicholas Paldino [.NET/C# MVP]" wrote:
Jan,

You said you can't get it to work there. What is the error that you
are
getting?

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

"Jan" <Ja*@discussions.microsoft.com> wrote in message
news:BE**********************************@microsof t.com...
> We have a VB dll that invokes a C# dll. The C# dll references 3 other
> dlls -
> one is a .NET dll, the other two are win32 COM dlls. I have a script
> that
> invokes the VB dll which in turn successfully invokes the C# dll on my
> development machine.
>
> Next, I tried deploying to a stage server, but couldn't get the same
> test
> to
> work there. It seems the C# dll is not being invoked. I moved the C#
> dll
> and it's referenced .net and Interop dlls. I registered all 4 dlls
> using:
> regasm mymain.dll
> regasm mydotnet.dll
> regasm Interop.First.dll
> regasm Interop.Second.dll
>
> I tried signing all the dlls:
> sn -k myMain.dll (repeat for others)
>
> Then tried gacutil for each dll, but get an error saying they cannot be
> added to the GAC because they are not strongly named, even after using
> sn.exe.
>
> I'm new to .NET - can anyone recommend the proper steps. I must be
> missing
> something between the environments (I am thinking Visual Studio does
> some
> registration for me that isn't happening on the stage machine?).
>
> Thanks,
> Jan
>
>


Nov 16 '05 #6
Jan
Sorry about the formatting- sent it before I was done formatting before:

public string ProcessMyMessage(string sMessage)
{
string sResult = string.Empty;
try
{
sResult = "AIC Appraisal successfully invoked. This is a test to
see if C# dll will work.";
}
catch (Exception e)
{
sResult = "Exception occurred in CSharp dll. Message is: " +
e.Message;
}
return sResult;
}
"Jan" wrote:
Yeah, I thought of that too, so tried returning the exception message and
still nothing. Here is what the public method in the C# dll looks like:

public string ProcessMyMessage(string sMessage)
{
string sResult = string.Empty;
try
{
sResult = "AIC Appraisal successfully invoked. This is a test to see if
C# dll will work.";
}
catch (Exception e)
{
sResult = "Exception occurred in CSharp dll. Message is: " + e.Message;
}
return sResult;
"Nicholas Paldino [.NET/C# MVP]" wrote:
Are you sure your code is not swallowing the exception? Code just
doesn't get ignored. Is this code in an event handler of some sort?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jan" <Ja*@discussions.microsoft.com> wrote in message
news:73**********************************@microsof t.com...
Well, that is the thing- I don't get an error- the C# dll is just not
being
invoked. To test it, I had each dll return a simple string so I would
know
which dlls had been invoked. On the stage box, I get the string back from
the vb dll, but not the C# dll. On my dev box, I get both strings back.

Any ideas?

Much obliged,
Jan

"Nicholas Paldino [.NET/C# MVP]" wrote:

> Jan,
>
> You said you can't get it to work there. What is the error that you
> are
> getting?
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mv*@spam.guard.caspershouse.com
>
> "Jan" <Ja*@discussions.microsoft.com> wrote in message
> news:BE**********************************@microsof t.com...
> > We have a VB dll that invokes a C# dll. The C# dll references 3 other
> > dlls -
> > one is a .NET dll, the other two are win32 COM dlls. I have a script
> > that
> > invokes the VB dll which in turn successfully invokes the C# dll on my
> > development machine.
> >
> > Next, I tried deploying to a stage server, but couldn't get the same
> > test
> > to
> > work there. It seems the C# dll is not being invoked. I moved the C#
> > dll
> > and it's referenced .net and Interop dlls. I registered all 4 dlls
> > using:
> > regasm mymain.dll
> > regasm mydotnet.dll
> > regasm Interop.First.dll
> > regasm Interop.Second.dll
> >
> > I tried signing all the dlls:
> > sn -k myMain.dll (repeat for others)
> >
> > Then tried gacutil for each dll, but get an error saying they cannot be
> > added to the GAC because they are not strongly named, even after using
> > sn.exe.
> >
> > I'm new to .NET - can anyone recommend the proper steps. I must be
> > missing
> > something between the environments (I am thinking Visual Studio does
> > some
> > registration for me that isn't happening on the stage machine?).
> >
> > Thanks,
> > Jan
> >
> >
>
>
>


Nov 16 '05 #7
Jan,

That's not going to do anything. You need to put an exception handler
around the code that is calling this through COM interop. This is almost
NEVER going to throw, since it's an assignment of a string. Unless you have
an out of memory exception, it will never throw.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jan" <Ja*@discussions.microsoft.com> wrote in message
news:1A**********************************@microsof t.com...
Sorry about the formatting- sent it before I was done formatting before:

public string ProcessMyMessage(string sMessage)
{
string sResult = string.Empty;
try
{
sResult = "AIC Appraisal successfully invoked. This is a test to
see if C# dll will work.";
}
catch (Exception e)
{
sResult = "Exception occurred in CSharp dll. Message is: " +
e.Message;
}
return sResult;
}
"Jan" wrote:
Yeah, I thought of that too, so tried returning the exception message and
still nothing. Here is what the public method in the C# dll looks like:

public string ProcessMyMessage(string sMessage)
{
string sResult = string.Empty;
try
{
sResult = "AIC Appraisal successfully invoked. This is a test to see if
C# dll will work.";
}
catch (Exception e)
{
sResult = "Exception occurred in CSharp dll. Message is: " + e.Message;
}
return sResult;
"Nicholas Paldino [.NET/C# MVP]" wrote:
> Are you sure your code is not swallowing the exception? Code just
> doesn't get ignored. Is this code in an event handler of some sort?
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mv*@spam.guard.caspershouse.com
>
> "Jan" <Ja*@discussions.microsoft.com> wrote in message
> news:73**********************************@microsof t.com...
> > Well, that is the thing- I don't get an error- the C# dll is just not
> > being
> > invoked. To test it, I had each dll return a simple string so I
> > would
> > know
> > which dlls had been invoked. On the stage box, I get the string back
> > from
> > the vb dll, but not the C# dll. On my dev box, I get both strings
> > back.
> >
> > Any ideas?
> >
> > Much obliged,
> > Jan
> >
> > "Nicholas Paldino [.NET/C# MVP]" wrote:
> >
> >> Jan,
> >>
> >> You said you can't get it to work there. What is the error that
> >> you
> >> are
> >> getting?
> >>
> >> --
> >> - Nicholas Paldino [.NET/C# MVP]
> >> - mv*@spam.guard.caspershouse.com
> >>
> >> "Jan" <Ja*@discussions.microsoft.com> wrote in message
> >> news:BE**********************************@microsof t.com...
> >> > We have a VB dll that invokes a C# dll. The C# dll references 3
> >> > other
> >> > dlls -
> >> > one is a .NET dll, the other two are win32 COM dlls. I have a
> >> > script
> >> > that
> >> > invokes the VB dll which in turn successfully invokes the C# dll
> >> > on my
> >> > development machine.
> >> >
> >> > Next, I tried deploying to a stage server, but couldn't get the
> >> > same
> >> > test
> >> > to
> >> > work there. It seems the C# dll is not being invoked. I moved
> >> > the C#
> >> > dll
> >> > and it's referenced .net and Interop dlls. I registered all 4
> >> > dlls
> >> > using:
> >> > regasm mymain.dll
> >> > regasm mydotnet.dll
> >> > regasm Interop.First.dll
> >> > regasm Interop.Second.dll
> >> >
> >> > I tried signing all the dlls:
> >> > sn -k myMain.dll (repeat for others)
> >> >
> >> > Then tried gacutil for each dll, but get an error saying they
> >> > cannot be
> >> > added to the GAC because they are not strongly named, even after
> >> > using
> >> > sn.exe.
> >> >
> >> > I'm new to .NET - can anyone recommend the proper steps. I must
> >> > be
> >> > missing
> >> > something between the environments (I am thinking Visual Studio
> >> > does
> >> > some
> >> > registration for me that isn't happening on the stage machine?).
> >> >
> >> > Thanks,
> >> > Jan
> >> >
> >> >
> >>
> >>
> >>
>
>
>

Nov 16 '05 #8
Jan
Thx.. the vb Com was swallowing the exception. Now I get the error: "File
or assembly name MyCSharpDLL, or one of its dependencies, was not found."

I've run regasm (with and without the tlb parameter) on it, what could be
missing?

"Nicholas Paldino [.NET/C# MVP]" wrote:
Jan,

That's not going to do anything. You need to put an exception handler
around the code that is calling this through COM interop. This is almost
NEVER going to throw, since it's an assignment of a string. Unless you have
an out of memory exception, it will never throw.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jan" <Ja*@discussions.microsoft.com> wrote in message
news:1A**********************************@microsof t.com...
Sorry about the formatting- sent it before I was done formatting before:

public string ProcessMyMessage(string sMessage)
{
string sResult = string.Empty;
try
{
sResult = "AIC Appraisal successfully invoked. This is a test to
see if C# dll will work.";
}
catch (Exception e)
{
sResult = "Exception occurred in CSharp dll. Message is: " +
e.Message;
}
return sResult;
}
"Jan" wrote:
Yeah, I thought of that too, so tried returning the exception message and
still nothing. Here is what the public method in the C# dll looks like:

public string ProcessMyMessage(string sMessage)
{
string sResult = string.Empty;
try
{
sResult = "AIC Appraisal successfully invoked. This is a test to see if
C# dll will work.";
}
catch (Exception e)
{
sResult = "Exception occurred in CSharp dll. Message is: " + e.Message;
}
return sResult;
"Nicholas Paldino [.NET/C# MVP]" wrote:

> Are you sure your code is not swallowing the exception? Code just
> doesn't get ignored. Is this code in an event handler of some sort?
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mv*@spam.guard.caspershouse.com
>
> "Jan" <Ja*@discussions.microsoft.com> wrote in message
> news:73**********************************@microsof t.com...
> > Well, that is the thing- I don't get an error- the C# dll is just not
> > being
> > invoked. To test it, I had each dll return a simple string so I
> > would
> > know
> > which dlls had been invoked. On the stage box, I get the string back
> > from
> > the vb dll, but not the C# dll. On my dev box, I get both strings
> > back.
> >
> > Any ideas?
> >
> > Much obliged,
> > Jan
> >
> > "Nicholas Paldino [.NET/C# MVP]" wrote:
> >
> >> Jan,
> >>
> >> You said you can't get it to work there. What is the error that
> >> you
> >> are
> >> getting?
> >>
> >> --
> >> - Nicholas Paldino [.NET/C# MVP]
> >> - mv*@spam.guard.caspershouse.com
> >>
> >> "Jan" <Ja*@discussions.microsoft.com> wrote in message
> >> news:BE**********************************@microsof t.com...
> >> > We have a VB dll that invokes a C# dll. The C# dll references 3
> >> > other
> >> > dlls -
> >> > one is a .NET dll, the other two are win32 COM dlls. I have a
> >> > script
> >> > that
> >> > invokes the VB dll which in turn successfully invokes the C# dll
> >> > on my
> >> > development machine.
> >> >
> >> > Next, I tried deploying to a stage server, but couldn't get the
> >> > same
> >> > test
> >> > to
> >> > work there. It seems the C# dll is not being invoked. I moved
> >> > the C#
> >> > dll
> >> > and it's referenced .net and Interop dlls. I registered all 4
> >> > dlls
> >> > using:
> >> > regasm mymain.dll
> >> > regasm mydotnet.dll
> >> > regasm Interop.First.dll
> >> > regasm Interop.Second.dll
> >> >
> >> > I tried signing all the dlls:
> >> > sn -k myMain.dll (repeat for others)
> >> >
> >> > Then tried gacutil for each dll, but get an error saying they
> >> > cannot be
> >> > added to the GAC because they are not strongly named, even after
> >> > using
> >> > sn.exe.
> >> >
> >> > I'm new to .NET - can anyone recommend the proper steps. I must
> >> > be
> >> > missing
> >> > something between the environments (I am thinking Visual Studio
> >> > does
> >> > some
> >> > registration for me that isn't happening on the stage machine?).
> >> >
> >> > Thanks,
> >> > Jan
> >> >
> >> >
> >>
> >>
> >>
>
>
>


Nov 16 '05 #9

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

Similar topics

5
by: Charles A. Lackman | last post by:
I am working on a application that has many custom made dlls. Actually, for this app each dll is a different form. I am able, with no problem to reference and instantiate them to use their public...
2
by: Johann Blake | last post by:
I can hardly believe I'm the first one to report this, but having gone through the newsgroup, it appears that way. I would like to open a solution in the VS.NET IDE that consists of multiple...
5
by: Charles A. Lackman | last post by:
I am working on a application that has many custom made dlls. Actually, for this app each dll is a different form. I am able, with no problem to reference and instantiate them to use their public...
5
by: Charles A. Lackman | last post by:
I am working on a application that has many custom made dlls. Actually, for this app each dll is a different form. I am able, with no problem to reference and instantiate them to use their public...
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: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.