Hello Folks,

This post targets to windows Development DLL dependency issue

Operating System Windows 7, 8, 10, Server Version 2008, 2012, 2016

Problem

In general, when we develop windows forms, windows patches, windows services and windows related applications that would run in all the windows machines, they may require lot of other dependencies like Visual-Redistributable packages 2013, 2015, 2017, .Net frameworks 4, 4.5, 4.6.1 and so on.

These dependencies might be already packed with the operating system or installed by local user. Though, we might get run time errors while we run those application in multiple target windows operating systems due to missing DLLs.

Cause

Microsoft ships different version of internal dynamic linked libraries (DLL) based on the operating system, x86 / x64 bit of windows. They might not be linked properly with our application or locating in the wrong folder path.

Usually any application installed in windows looks for the linked DLLin following order

Same drive location (where application is installed) System32 folder (in case of 64 bit app) SysWOW64 folder (in case of 32 bit app and 64 bit OS) Other linked foldersand Environment Path folders

Further more information onDLL search order is availabe at https://docs.microsoft.com/en-us/windows/desktop/dlls/dynamic-link-library-search-order

Testing

All operating system in windows would be the target to test our applications, but when we run we may face issues that are not clear in nature, and we would have to dig much about the high level issue and find the real cause after the long run and diagnosis.This is time consuming.

solution

We could take all the dependency dlls along with our application to the installed directory. This resolves the problem, But we are copying DLLs unnecessarily when it is already exists in System32 folder or somewhere in the system.

Preferred Solutions could be as follows.

Differentiate DLLs that are shipped on all targets and not. Run the Dependency Walker http://www.dependencywalker.com/ in the DLLs and find whether all internal reference is Exists. Collect the list of DLLs that are not shipped with all target OS and pack them with the setup.exe / cab files.

This resolves the issue in preferred way.

本文系统(windows)相关术语:三级网络技术 计算机三级网络技术 网络技术基础 计算机网络技术

代码区博客精选文章
分页:12
转载请注明
本文标题:Windows Development (C++, C#, …) Targeting All Win Platforms DLL Dependen ...
本站链接:https://www.codesec.net/view/627836.html


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 系统(windows) | 评论(0) | 阅读(83)