473,403 Members | 2,270 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,403 software developers and data experts.

Deploying native Windows DLL used by .NET applications

We have a native Windows DLL (let's call it native.dll) we developed a .NET
interface for (let's say managed.dll). When a .NET application now uses the
..NET interface to talk to the Windows DLL we always thought that managed.dll
must be copied to the application directory (where the .NET application
runs) and that native.dll can be anywhere as long it is in PATH or is
somehow else found by Windows.

The problem is however that the .NET application hangs on some computers
unless native.dll is copied to the application directory. The problem is
reproducable but exists only on some computers. On one computer native.dll
can be copied to the Windows directory and everything works fine. On the
other computer native.dll must be in the applicaton directory as otherwise
the .NET application hangs when it tries to access native.dll.

I used Dependency Walker (from http://www.dependencywalker.com/) to make
sure that in every scenario all DLLs can be found. Thus I wonder why on some
computer native.dll must be copied to the application directory for the .NET
application not to hang. Is there a deployment recommendation like this? Or
is this a bug in the .NET framework or CLR which doesn't locate DLLs
correctly sometimes?

Boris
Aug 25 '06 #1
3 1433
Boris,

Do you use the setup and deployment project tool from Visual Studio?

http://msdn2.microsoft.com/en-us/library/ms235317.aspx

Cor

"Boris" <bo***@gtemail.netschreef in bericht
news:%2****************@TK2MSFTNGP04.phx.gbl...
We have a native Windows DLL (let's call it native.dll) we developed a
.NET interface for (let's say managed.dll). When a .NET application now
uses the .NET interface to talk to the Windows DLL we always thought that
managed.dll must be copied to the application directory (where the .NET
application runs) and that native.dll can be anywhere as long it is in
PATH or is somehow else found by Windows.

The problem is however that the .NET application hangs on some computers
unless native.dll is copied to the application directory. The problem is
reproducable but exists only on some computers. On one computer native.dll
can be copied to the Windows directory and everything works fine. On the
other computer native.dll must be in the applicaton directory as otherwise
the .NET application hangs when it tries to access native.dll.

I used Dependency Walker (from http://www.dependencywalker.com/) to make
sure that in every scenario all DLLs can be found. Thus I wonder why on
some computer native.dll must be copied to the application directory for
the .NET application not to hang. Is there a deployment recommendation
like this? Or is this a bug in the .NET framework or CLR which doesn't
locate DLLs correctly sometimes?

Boris

Aug 26 '06 #2
Cor Ligthert [MVP] wrote:

Hi Cor,
Do you use the setup and deployment project tool from Visual Studio?

http://msdn2.microsoft.com/en-us/library/ms235317.aspx
no, we use Inno Setup. However the problem is not related to the installer.
It can be reproduced by simply copying all files (the .NET application and
its depending DLLs) to a folder. If they are all in the folder everything
works. If I copy then native.dll to another folder like C:\Windows the .NET
application hangs. There is no error message, and Dependency Walker also
clearly shows that all DLL dependencies can be resolved. The only thing
which is different from a native Windows application is that here a managed
DLL depends on native.dll.

There is no COM involved either - no file is registered. native.dll depends
on msvcp71.dll and msvcr71.dll. It doesn't matter where these two DLLs are -
they can be in C:\Windows for example. As long as native.dll is in the
application directory everything works. Otherwise the .NET application hangs
and eats all CPU time. This is all seen on a Windows Server 2003 SP1 system.

Boris
[...]

Aug 26 '06 #3
The problem has been solved. There were different versions of some DLLs on
the server. After cleaning up this mess everything worked again.

Boris
Aug 29 '06 #4

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

Similar topics

2
by: Jim | last post by:
Can someone please explain the difference between Static Qt Applications and Dynamic Qt Applications? The Trolltech documentation only says that for Dynamic Qt Applications you need either qt.dll...
10
by: callmebill | last post by:
I'm getting my feet wet with making Python talk to MySQL via ODBC. I started on Windows, and it went smoothly enough due to the ODBC stuff that apparently is native to Python at least on windows...
2
by: pieter.breed | last post by:
Hi All, The company I work for has traditionally used COM/ActiveX for the solutions that it provides. We are in the process of moving to .NET and a few applications have been written in VB.NET...
3
by: Chris Dunaway | last post by:
A quick scan of the group did not immediately reveal an answer to my questions so here goes. First let me describe my app and then I'll ask the questions. I am writing a Windows Forms App (not...
0
by: Reini | last post by:
We are developing an Asp.Net 2.0 application (Web Administration) for the IIS 5.0 to 6.0 and the W2K to W2K3 operating system. The application consists of several layers. One layer is a .Net 2.0...
6
by: tendim | last post by:
G'day group. Currently our organization us using VB6 based applications, and I am trying to push forward and migrate some of the smaller things to VB.NET, eventually migrating all applications...
6
by: Ryan | last post by:
Is there any way to save a VB 2005 created application as an .MSI install file? The only method I see is to publish as a .EXE. Curious because I want to push out an application with Group Policy....
3
by: Kenneth Porter | last post by:
Are there any HOWTOs that show how to do this? My client is using C# in VS 2008 and my unmanaged DLL and managed C++/CLI wrapper are in VS 2005. What do I need to do to make sure the necessary...
8
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
Is there a way to write native C# applications? I used to write a lot of native applications, but we used Borland to do it. These days, I work for a different company that fully embraces...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.