app can't find needed dll

L

LJB

I have a C# app I'm working on that can't find a companion dll. The dll is
written in .Net managed c++ but part of an unmanaged c++ project by another
in-house developer. The dll isn't registered and it won't be. I can compile
my C# app OK with a reference to the dll's deployed location, however my app
will not run unless a copy of the dll is in my exe location. I have even
added the dll's deployed location to my path environment variable but still
no luck.

There is other odd behavior with this dll. If I set a reference to it the
VS2008 properties report the version as 0.0.0.0 and runtime version as
v2.0.50727. When my app runs it states it can't find version 0.0.0.0. The
version of the actual dll file reported in Windows Explorer is 1.1.0.18.

I'm not very familiar with these dll's and deployment so don't know what to
ask the dll developer to change. Any suggestions would be much appreciated.

Thanks,
LJB
 
M

Mr. Arnold

LJB said:
I have a C# app I'm working on that can't find a companion dll. The dll is
written in .Net managed c++ but part of an unmanaged c++ project by another
in-house developer. The dll isn't registered and it won't be. I can compile
my C# app OK with a reference to the dll's deployed location, however my app
will not run unless a copy of the dll is in my exe location. I have even
added the dll's deployed location to my path environment variable but still
no luck.

The DLL's must be at the location of the exe. .Net doesn't need DLL's
registered, but the DLL(s) must be at the location of the exe so .NET can
find the DLL
There is other odd behavior with this dll. If I set a reference to it the
VS2008 properties report the version as 0.0.0.0 and runtime version as
v2.0.50727. When my app runs it states it can't find version 0.0.0.0. The
version of the actual dll file reported in Windows Explorer is 1.1.0.18.

You have to fix this getting the right version.
I'm not very familiar with these dll's and deployment so don't know what to
ask the dll developer to change. Any suggestions would be much appreciated.

I suggeet you get all needed DLL's in the location of where the exe is
located.
 
L

LJB

Mr. Arnold said:
The DLL's must be at the location of the exe. .Net doesn't need DLL's
registered, but the DLL(s) must be at the location of the exe so .NET can
find the DLL

You have to fix this getting the right version.

I suggeet you get all needed DLL's in the location of where the exe is
located.

The problem with placing the dll in the same location is that not every user
has both applications and locations. Everyone has appA which deploys the
dll. Only some users have appB which uses that dll and some from appC. All
three applications are installed in a separate locations.

I'm not quite ready to accept "DLL(s) must be at the location of the exe".
My appB uses a number of dll's from appC just fine. AppC is purchased
software and its dll's are not registered either. I sometimes see ...GAC...
or something like that in their properties and when I do it tells me those
dll's won't work until I create a new reference to them in their actual
location again. What I need is to figure out is how to make appA's dll work
just like appC's.

Thanks,
LJB
 
M

Mr. Arnold

LJB said:
The problem with placing the dll in the same location is that not every user
has both applications and locations. Everyone has appA which deploys the
dll. Only some users have appB which uses that dll and some from appC. All
three applications are installed in a separate locations.

I'm not quite ready to accept "DLL(s) must be at the location of the exe".
My appB uses a number of dll's from appC just fine. AppC is purchased
software and its dll's are not registered either. I sometimes see ...GAC...
or something like that in their properties and when I do it tells me those
dll's won't work until I create a new reference to them in their actual
location again. What I need is to figure out is how to make appA's dll work
just like appC's.

Good luck :)
 
K

kndg

I have a C# app I'm working on that can't find a companion dll. The dll is
written in .Net managed c++ but part of an unmanaged c++ project by another
in-house developer. The dll isn't registered and it won't be. I can compile
my C# app OK with a reference to the dll's deployed location, however my app
will not run unless a copy of the dll is in my exe location. I have even
added the dll's deployed location to my path environment variable but still
no luck.

There is other odd behavior with this dll. If I set a reference to it the
VS2008 properties report the version as 0.0.0.0 and runtime version as
v2.0.50727. When my app runs it states it can't find version 0.0.0.0. The
version of the actual dll file reported in Windows Explorer is 1.1.0.18.

I'm not very familiar with these dll's and deployment so don't know what to
ask the dll developer to change. Any suggestions would be much appreciated.

Thanks,
LJB

Hi LJB,

Not sure if I understand your problem correctly, but, you could sign the
dll and install it in GAC. That way, any program can reference it
without having the dll to be reside on the same directory as the executable.

Regards.
 
L

LJB

kndg said:
Hi LJB,

Not sure if I understand your problem correctly, but, you could sign the
dll and install it in GAC. That way, any program can reference it without
having the dll to be reside on the same directory as the executable.

Regards.

I have learned from multiple sources that GAC is the only way possible. So,
can my app's install register another app's dll? Is gacutil the tool to use
and is it available on a client's pc?

Thanks,
 
K

kndg

I have learned from multiple sources that GAC is the only way possible. So,
can my app's install register another app's dll? Is gacutil the tool to use
and is it available on a client's pc?

Thanks,

Hi LJB,

I'm not sure what do you mean by "register".
It's the act of signing the assembly (dll) and install it in GAC.
The steps are as follow:

1. Have the public key ready. If you're working on a team/company,
usually they already have one and you should use that. If not, you can
easily create one by using the sn.exe tool (e.g sn -k myKey.snk). If
you're using Visual Studio IDE, right-click on the project, choose
property and then click the Signing tab.

2. Compile your assembly with that key (csc /keyfile:myKey.snk ...). If
using the IDE, the above step is suffice (make sure you check 'Sign the
assembly' checkbox).

3. Use the gacutil.exe tool to install your assembly in GAC (e.g gacutil
/i assemblyname. Or, you can create a setup project in Visual Studio and
add your assembly (or project output) to GAC folder (File System -> Add
Special Folder -> Global Assembly Cache Folder).

Gacutil tool is not available on the client pc unless they have Windows
SDK installed. You can package the tool with the installer (just the
gacutil tool, not the whole SDK) and run it during installation process.
If you use the IDE setup project as on step #3, the process is automatic.

You may refer below for more information.
http://msdn.microsoft.com/en-us/library/k5b5tt23.aspx
http://msdn.microsoft.com/en-us/library/ex0ss12c.aspx
http://msdn.microsoft.com/en-us/library/6z8af6zs.aspx

Regards.
 

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