Depends.exe — как исправить ошибки [решено]

Meaning of Dependency Walker depends.exe failure?

Ошибки EXE происходят по ряду причин, но в основном из-за проблем с исполняемыми файлами или EXE-файлами. EXE — это расширение приложения в Windows. Подобно другим типам файлов, встроенных в вашу компьютерную систему, EXE-файлы могут время от времени входить в ошибки. Некоторые ошибки являются общими, но некоторые из них трудно устранить и устранить.

Программное обеспечение, которое вы используете, и приложения, необходимые для работы операционной системой, используют EXE-файлы для выполнения своих задач. В этой записке ПК содержит много EXE-файлов, возможно, тысячи, что позволяет с большой вероятностью иметь место ошибка. Иногда ошибки EXE могут повлиять на вашу компьютерную систему. Программы могут перестать работать, или ваш компьютер может замедлить работу. Хуже того, EXE-ошибка может помешать вам получить доступ к вашему компьютеру и войти в него.

Некоторые проблемы, которые могут вызвать ошибки EXE:

  • Вирусы, вредоносные программы и программы-шпионы
  • Неверные, поврежденные, поврежденные или устаревшие файлы или драйверы
  • Конфликт записей в системном реестре Windows
  • Конфликты приложений

Overview

For each dependency, you specify the name of the package you depend on
and the range of versions of that package that you allow.
You can also specify the
,
which tells pub how to locate the package,
and any additional description that the source needs to find the package.

Here is an example of specifying a dependency:

This YAML code creates a dependency on the package
using the default source (pub.dev) and
allowing any version from to (but not including ).
See the
section of this page for syntax details.

If you want to specify a source, the syntax looks a bit different:

This YAML code creates a dependency on the package
using the source.
Everything under the source key (here, just a map with a key)
is the description that gets passed to the source.
Each source has its own description format,
which is described in the section
of this page.
The version constraint is optional but recommended.

Use this long form when you don’t use the default source or when you have a
complex description that you need to specify.
But in most cases, you’ll just use the simple
form.

Как пользоваться

Теперь рассмотрим процедуру установки и варианты использования утилиты.

Загрузка и установка

С помощью кнопки внизу страницы вы можете скачать версию Depends для 32 или 64-разрядных систем Windows. Вам достаточно распаковать архив на жесткий диск в удобную папку 3 файла. После этого можно запустить Depends.exe двойным кликом мышки. Активация или взлом не потребуются.

Инструкция по работе

Рассмотрим простой сценарий использования ПО. Например, какое-либо приложение дает сбой, который не устраняется известными способами. Для начала проверки откройте меню File и нажмите Open. Укажите путь до исполняемого файла с расширением EXE и подождите некоторое время. Утилита может зависнуть на 1-2 минуты.

В левой панели главного окна появится древо библиотек с ветками, в которых расположены зависимые компоненты. Необходимо просмотреть весь список и найти файл, который выдает ошибку. Зачастую проблемы связаны с повреждением и отсутствием DLL-библиотек. Зная название, вы сможете отыскать необходимый файл и вставить его в папку с проблемным приложением.

Более опытный пользователь сможет применять другие инструменты для углубленного анализа и исправления ошибок. Для удобства можно настраивать расположение панелей в окне приложения. Все основные инструменты находятся на верхней панели в виде кнопок быстрого доступа. Часть функций вынесена в верхние меню. В нижней части отображается развернутый текст ошибки или предупреждения на английском языке.

Scope validation

When the app runs in the environment and calls to build the host, the default service provider performs checks to verify that:

  • Scoped services aren’t resolved from the root service provider.
  • Scoped services aren’t injected into singletons.

The root service provider is created when BuildServiceProvider is called. The root service provider’s lifetime corresponds to the app’s lifetime when the provider starts with the app and is disposed when the app shuts down.

Scoped services are disposed by the container that created them. If a scoped service is created in the root container, the service’s lifetime is effectively promoted to singleton because it’s only disposed by the root container when the app shuts down. Validating service scopes catches these situations when is called.

DLL dependencies

When a program or a DLL uses a DLL function in another DLL, a dependency is created. Therefore, the program is no longer self-contained, and the program may experience problems if the dependency is broken. For example, the program may not run if one of the following actions occurs:

  • A dependent DLL is upgraded to a new version.
  • A dependent DLL is fixed.
  • A dependent DLL is overwritten with an earlier version.
  • A dependent DLL is removed from the computer.

These actions are known as DLL conflicts. If backward compatibility is not enforced, the program may not successfully run.

The following list describes the changes that have been introduced in Windows 2000 and in later Windows operating systems to help minimize dependency issues:

  • Windows File Protection

    In Windows File Protection, the operating system prevents system DLLs from being updated or deleted by an unauthorized agent. Therefore, when a program installation tries to remove or update a DLL that is defined as a system DLL, Windows File Protection will look for a valid digital signature.

  • Private DLLs

    Private DLLs let you isolate a program from changes that are made to shared DLLs. Private DLLs use version-specific information or an empty .local file to enforce the version of the DLL that is used by the program. To use private DLLs, locate your DLLs in the program root folder. Then, for new programs, add version-specific information to the DLL. For old programs, use an empty .local file. Each method tells the operating system to use the private DLLs that are located in the program root folder.

What’s New in Version 2.2

Moved to new HTML help system and updated the help text.
Added support for MSDN 8.0 external help and updated the online help URL.
Improved Side-by-Side support that handles
DLL manifests and app.exe.local files.
Updated internal information about known OS versions, build numbers, and flags up to the Vista RC1 build.


What was New in Version 2.1

Support for Side-by-Side versioning of modules. This is a new feature introduced with Windows XP that allows applications to specify specific versions and/or locations of files it wishes to use.
Integration with Visual Studio help, MSDN help, and MSDN online to provide the ability to display detailed help for any known function.


What was New in Version 2.0

Detection of dynamically loaded modules, including details about which module actually called LoadLibrary to dynamically load the module.
Detection of dynamically called functions, including details about which module actually called GetProcAddress to obtain the function address.
Detection of delay-load dependencies. This is a new type of dependency that was introduced with Microsoft Visual C++ 6.0. They work on Windows 95/98/Me and Windows NT/2000/XP/2003/Vista/7/8/+.
Support for 64-bit Windows modules.
Console mode that allows Dependency Walker to be ran without its graphical interface being displayed. This is useful for batch files and unattended automation of Dependency Walker
features.
Command line options to configure module search order, column sorting, output files, profiling, and other settings.
Ability to monitor module entrypoints (like DllMain) looking for module initialization failures.
C++ function name undecorating to provide human readable C++ function prototypes including function names, return types, and parameter types.
User definable module search paths with support for «KnownDLLs» and the «App Paths» registry keys. Search paths can be saved and loaded from within the graphical interface or from the command line.
Ability to save a module’s session to a text report file for easy viewing in any text viewer.
Ability to save a module’s session to a comma separated value (CSV) file for easy importing into other applications.
Ability to save a snapshot of an entire module session to an image file, which can be loaded by Dependency Walker at a later time on any computer.
Module profiling to detect dynamic dependencies, child processes, thread activity, and exceptions. Child processes can also be profiled for their dependencies.
Ability to control what file extensions Dependency Walker will add the «View Dependencies» menu item to a file’s context menu in explorer.
Added hotkeys to help match imports with exports, and modules in the list view with modules in the tree view. Also added hotkeys to locate the previous, next, or original instance of a module in the tree view.
Added some new columns to the Module List View. They include Link Time Stamp, Link Checksum, Real Checksum, Symbols, Actual Base, Virtual Size, and Load Order.
Added an OS Information dialog. This information is also saved to text and Dependency Walker Image (DWI) files.
All list views can now be sorted by icon, which provides an easy way of grouping items of similar type.
You can now search all list views for text by simply typing in a few characters to match in the currently sorted column.
Added color-coding to the module list view and log view to help highlight problems.

DLL advantages

The following list describes some of the advantages that are provided when a program uses a DLL:

  • Uses fewer resources

    When multiple programs use the same library of functions, a DLL can reduce the duplication of code that is loaded on the disk and in physical memory. This can greatly influence the performance of not just the program that is running in the foreground, but also other programs that are running on the Windows operating system.

  • Promotes modular architecture

    A DLL helps promote developing modular programs. This helps you develop large programs that require multiple language versions or a program that requires modular architecture. An example of a modular program is an accounting program that has many modules that can be dynamically loaded at run time.

  • Eases deployment and installation

    When a function within a DLL needs an update or a fix, the deployment and installation of the DLL does not require the program to be relinked with the DLL. Additionally, if multiple programs use the same DLL, the multiple programs will all benefit from the update or the fix. This issue may more frequently occur when you use a third-party DLL that is regularly updated or fixed.

Dependency Walker

Dependency walker (a.k.a. Depends) is a simple yet powerful tool that you’ll find invaluable if you have to track the native dependencies of your components (EXE or DLL).
Dependency Walker can be used for static (without having to run any code) or dynamic analysis (with dependencies tracked while running your code).

I’ll illustrate its usefulness with a from scratch sample.
Say you are in the very common situation where you have a native dependency which itself has dependencies.
Whatever the technology used you have this situation :

 ________       _________       _________
| CALLER | --> | NATIVE1 | --> | NATIVE2 |
 --------       ---------       ---------

(By the way isn’t it a stunning demonstration of my awesome ASCII art skills?)

When the «native2» dependency is missing, often the root cause remains hidden and you get a generic error message like «Unable to load DLL ‘native1.dll’ : The specified module could not be found» without mentioning «native2».

So you first naively double-check that your «native1.dll» dependency is here and accessible but once you’re convinced «native1.dll» is not the root-cause you realize you definitely need more information to troubleshoot the issue.

Let’s reproduce this situation with a very basic sample and troubleshoot it with Dependency Walker (source code is packaged here : Depends sample source code).

Here is the native2 C source-code:

__declspec(dllexport) void g()
{
}

and the native1 C code that uses native2 function g:

extern void g();

__declspec(dllexport) void f()
{
    g();
}

Now is the consumer of native1, a C# application, Test:

using System.Runtime.InteropServices;

class Test
{
    
    extern static void f();

    static void Main()
    {
        f();
    }
}

So the Test application calls the f function of native1 and f calls itself the g function of native2.
As you’ve guessed all this stuff does…nothing.

So let’s build our amazing application that does nothing!

First open a Visual Studio Command Prompt and navigate to the folder containing your source-code files and then follow the guide:

  • we first compile native2:
    >cl /LD native2.c
    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    native2.c
    Microsoft (R) Incremental Linker Version 10.00.40219.01
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    /out:native2.dll
    /dll
    /implib:native2.lib
    native2.obj
       Creating library native2.lib and object native2.exp

    We now have a «native2.dll» DLL and a «native2.lib» exports file.

  • then we compile native1:
    >cl /LD native1.c native2.lib
    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    native1.c
    Microsoft (R) Incremental Linker Version 10.00.40219.01
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    /out:native1.dll
    /dll
    /implib:native1.lib
    native1.obj
    native2.lib
       Creating library native1.lib and object native1.exp

    This generates «native1.dll».

  • and finally we compile Test:
    >csc /platform:x86 Test.cs
    Microsoft (R) Visual C# Compiler version 4.0.30319.17929
    for Microsoft (R) .NET Framework 4.5
    Copyright (C) Microsoft Corporation. All rights reserved.

We now have a useless application, Test.exe, that does what it is intended for and we can prove it by running it:

>Test.exe

>

Nothing, no errors, the boss will be happy.

So far so good…

Now let’s play and imagine that the application has been deployed on another environment where native2.dll is missing or is not where it is expected.
To simulate this situation delete or rename the native2.dll file an rerun
Test.exe:

>Test.exe

Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'native1.dl
l': The specified module could not be found. (Exception from HRESULT: 0x8007007E
)
   at Test.f()
   at Test.Main()

Oops! we’ve broken something, let’s see what Depends have to say about it.

Run the «depends.exe» application you’ve downloaded from the Dependency Walker website.
From here open the native1.dll file (you can simply drag-and-drop it from your Windows explorer). You should first see an error popup saying that something is wrong with your DLL:

Depends errors popup

So at this point Depends is only telling you something you already knew.

So click OK to be presented with the main interface where you have more information:

Depends UI

Interesting : we now see the root cause : the «native2.dll» file is missing.

From here you can check if the «native2.dll» is on the system; if no install it, if yes check that its folder is correctly referenced in the PATH environment variable.

Плюсы и минусы

Дополним обзор главными достоинствами и недостатками описываемого приложения.

Достоинства:

  • При желании пользователь может быстро переключиться между командной строкой и графической оболочкой.
  • Минимальные системные требования. Утилита будет работать даже на стареньком компьютере.
  • Подходит для х32 и х64 разрядных систем.
  • Требует минимум места на PC.
  • Не нужно проводить инсталляцию. Достаточно скачать архив и запустить программу.
  • Может проводить анализ одновременно нескольких файлов.

Недостатки:

  • Подходит только для опытных пользователей.
  • Русский язык пока недоступен.

Summary

In describing what a DLL is, this article describes dynamic linking methods, DLL dependencies, DLL entry points, exporting DLL functions, and DLL troubleshooting tools.

This article finishes with a high-level comparison of DLLs to the Microsoft .NET Framework assemblies.

For the Windows operating systems, much of the functionality of the operating system is provided by DLL. Additionally, when you run a program on one of these Windows operating systems, much of the functionality of the program may be provided by DLLs. For example, some programs may contain many different modules, and each module of the program is contained and distributed in DLLs.

The use of DLLs helps promote modularization of code, code reuse, efficient memory usage, and reduced disk space. Therefore, the operating system and the programs load faster, run faster, and take less disk space on the computer.

When a program uses a DLL, an issue that is called dependency may cause the program not to run. When a program uses a DLL, a dependency is created. If another program overwrites and breaks this dependency, the original program may not successfully run.

With the introduction of the .NET Framework, most dependency problems have been eliminated by using assemblies.

Service lifetimes

Services can be registered with one of the following lifetimes:

  • Transient
  • Scoped
  • Singleton

The following sections describe each of the preceding lifetimes. Choose an appropriate lifetime for each registered service.

Transient

Transient lifetime services are created each time they’re requested from the service container. This lifetime works best for lightweight, stateless services. Register transient services with AddTransient.

In apps that process requests, transient services are disposed at the end of the request.

Scoped

For web applications a scoped lifetime indicates that services are created once per client request (connection). Register scoped services with AddScoped.

In apps that process requests, scoped services are disposed at the end of the request.

When using Entity Framework Core, the AddDbContext extension method registers types with a scoped lifetime by default.

Note

Do not resolve a scoped service from a singleton and be careful not to do so indirectly, for example, through a transient service. It may cause the service to have incorrect state when processing subsequent requests. It’s fine to:

  • Resolve a singleton service from a scoped or transient service.
  • Resolve a scoped service from another scoped or transient service.

By default, in the development environment, resolving a service from another service with a longer lifetime throws an exception. For more information, see .

Singleton

Singleton lifetime services are created either:

  • The first time they’re requested.
  • By the developer, when providing an implementation instance directly to the container. This approach is rarely needed.

Every subsequent request of the service implementation from the dependency injection container uses the same instance. If the app requires singleton behavior, allow the service container to manage the service’s lifetime. Don’t implement the singleton design pattern and provide code to dispose of the singleton. Services should never be disposed by code that resolved the service from the container. If a type or factory is registered as a singleton, the container disposes the singleton automatically.

Register singleton services with AddSingleton. Singleton services must be thread safe and are often used in stateless services.

In apps that process requests, singleton services are disposed when the ServiceProvider is disposed on application shutdown. Because memory is not released until the app is shut down, consider memory use with a singleton service.

Warning

Do not resolve a scoped service from a singleton. It may cause the service to have incorrect state when processing subsequent requests. It’s fine to resolve a singleton service from a scoped or transient service.

Examples of dependency in a Sentence

the country’s dependency on foreign oil

a dependency on foreign oil

Recent Examples on the Web He was diagnosed with a rheumatic heart as a child and given large drug doses as a result, which turned into a dependency.

Lauren Puckett, Harper’s BAZAAR, «Will There Be A Season 2 of The Queen’s Gambit?,» 30 Oct. 2020 Changing schedules, long duty shifts and overnight missions led to chronic fatigue that fueled a voracious dependency on energy drinks, which left many GIs feeling frazzled.

Dave Philipps, Star Tribune, «The Army’s newest weapon – napping,» 12 Oct. 2020 Indoor Villages represent one type of low-barrier solution: a community of 100 tiny homes that would have easy access to mental health services, drug dependency treatment and assistance in finding housing, for instance.

NBC news, «Homeless and facing winter in Minneapolis,» 9 Oct. 2020 Carmen Chu, the city’s assessor-recorder, said the city is heavily dependent on large transactions over $10 million, and the tax would increase that dependency.

Trisha Thadani, SFChronicle.com, «Opponents of S.F. real estate tax measure raise over $2 million. Here’s why,» 1 Oct. 2020 The National First Responders Fund provides support including post-traumatic stress treatment, cancer prevention, toxic exposure, chemical dependency and critical incident support, outreach and activation.

Sophie Lewis, CBS News, «How to help victims of the West Coast’s apocalyptic wildfires,» 11 Sep. 2020 She is assigned to felony criminal cases, having earlier been a general magistrate presiding over dependency and truancy cases.

Orlando Sentinel Staff, orlandosentinel.com, «Election 2020: Meet the candidates in key Central Florida primary races on Aug. 18,» 4 Aug. 2020 These functions include: petitions for temporary civil protection orders and permanent protection order hearings; shelter hearings in dependency and neglect cases or other juvenile proceedings; and emergency mental health proceedings.

Kieran Nicholson, The Denver Post, «No Colorado juries will assemble through July 6 because of coronavirus concerns,» 5 May 2020 Signal Fails, an anonymous zine recently published on several anarchist Web sites, warns against dependency on a centralized service, particularly one running on mobile devices.

Anna Wiener, The New Yorker, «Taking Back Our Privacy,» 19 Oct. 2020

Boost

Boost is not a single dependency but rather a group of different
libraries. To use Boost headers-only libraries, simply add Boost as a
dependency.

To link against boost with Meson, simply list which libraries you
would like to use.

You can call multiple times with different modules and
use those to link against your targets.

If your boost headers or libraries are in non-standard locations you
can set the , or the and
environment variables. (added in 0.56.0) You can also set these
parameters as , , and in your
native or cross machine file. Note that machine file variables are
preferred to environment variables, and that specifying any of these
disables system-wide search for boost.

You can set the argument to to use boost
libraries that have been compiled for single-threaded use instead.

Dependency overrides

You can use to temporarily override all references
to a dependency.

For example, perhaps you are updating a local copy of transmogrify, a
published library package. Transmogrify is used by other packages in your
dependency graph, but you don’t want to clone each package locally
and change each pubspec to test your local copy of transmogrify.

In this situation, you can override the dependency using
to specify the directory holding the local
copy of the package.

The pubspec would look something like the following:

When you run or ,
the pubspec’s lockfile is updated to reflect the
new path to your dependency and, wherever transmogrify is used, pub
uses the local version instead.

You can also use to specify a particular
version of a package:

More information

A DLL is a library that contains code and data that can be used by more than one program at the same time. For example, in Windows operating systems, the Comdlg32 DLL performs common dialog box related functions. Therefore, each program can use the functionality that is contained in this DLL to implement an Open dialog box. This helps promote code reuse and efficient memory usage.

By using a DLL, a program can be modularized into separate components. For example, an accounting program may be sold by module. Each module can be loaded into the main program at run time if that module is installed. Because the modules are separate, the load time of the program is faster, and a module is only loaded when that functionality is requested.

Additionally, updates are easier to apply to each module without affecting other parts of the program. For example, you may have a payroll program, and the tax rates change each year. When these changes are isolated to a DLL, you can apply an update without needing to build or install the whole program again.

The following list describes some of the files that are implemented as DLLs in Windows operating systems:

  • ActiveX Controls (.ocx) files

    An example of an ActiveX control is a calendar control that lets you select a date from a calendar.

  • Control Panel (.cpl) files

    An example of a .cpl file is an item that is located in Control Panel. Each item is a specialized DLL.

  • Device driver (.drv) files

    An example of a device driver is a printer driver that controls the printing to a printer.

NuGet dependency version ranges

A package reference specifies the range of valid packages it allows. Typically, the package reference version in the project file is the minimum version and there’s no maximum.

The rules that NuGet uses when resolving dependencies are complex, but NuGet looks for the lowest applicable version. NuGet prefers the lowest applicable version over using the highest available because the lowest will have the least compatibility issues.

Because of NuGet’s lowest applicable version rule, it isn’t necessary to place an upper version or exact range on package references to avoid getting the latest version. NuGet already tries to find the lowest, most compatible version for you.

Upper version limits will cause NuGet to fail if there’s a conflict. For example, one library accepts exactly 1.0 while another library requires 2.0 or above. While breaking changes may have been introduced in version 2.0, a strict or upper limit version dependency guarantees an error.

DO NOT have NuGet package references with no minimum version.

AVOID NuGet package references that demand an exact version.

AVOID NuGet package references with a version upper limit.

Qt4 & Qt5

Meson has native Qt support. Its usage is best demonstrated with an
example.

Here we have an UI file created with Qt Designer and one source and
header file each that require preprocessing with the tool. We
also define a resource file to be compiled with . We just have to
tell Meson which files are which and it will take care of invoking all
the necessary tools in the correct order, which is done with the
method of the module. Its output is simply put in
the list of sources for the target. The keyword of
works just like it does with Boost. It tells which
subparts of Qt the program uses.

You can set the keyword argument to to use the
function provided by qtmain static library (this argument does nothing on platforms
other than Windows).

Setting the optional keyword to true adds the private header
include path of the given module(s) to the compiler flags. (since v0.47.0)

Note using private headers in your project is a bad idea, do so at your own
risk.

may be , or .

Оцените статью
Рейтинг автора
5
Материал подготовил
Андрей Измаилов
Наш эксперт
Написано статей
116
Добавить комментарий