Skip to content

Empty DOTNET_STARTUP_HOOKS causes error entries in Application log in Windows. #82260

Closed

Description

@BertanAygun

Description

In Visual Studio service hub process, we set DOTNET_STARTUP_HOOKS variable to empty string via ProcessStartInfo.Environment indexer.

In .Net runtime 6.0.13, this is causing errors as below in the Application log:

Description: A .NET application failed.
Application: ServiceHub.Host.Extensibility.exe
Path:
Message: Failed to read environment variable [DOTNET_STARTUP_HOOKS], HRESULT: 0x800700CB

These errors can be confusing as the application doesn't actually fail due to this error and continues to execute.

Reproduction Steps

Set DOTNET_STARTUP_HOOKS to empty string via ProcessStartInfo in a console app and launch the process.

Expected behavior

No errors to be logged as empty DOTNET_STARTUP_HOOKS seem to be a valid value.

Actual behavior

A misleading error entry is logged.

Regression?

Not sure

Known Workarounds

Ignoring the error

Configuration

.Net runtime 6.0.13
Windows 11, amd64

I don't believe this is configuration specific but haven't tested.

Other information

No response

Activity

  1. ghost added
    untriaged
    on Feb 16, 2023
  2. elinor-fung commented on Feb 17, 2023

    @elinor-fung
    Member

    Same problem as #54073

    In addition to what @vitek-karas already called out in #54073 (comment), we should probably also do a pass over all the trace::error calls in our pal functions to see if they actually represent hard errors.

  3. removed
    untriaged
    on Feb 17, 2023
  4. added this to the 8.0.0 milestone on Feb 17, 2023
  5. ghost added
    in-pr
    on Apr 11, 2023
  6. ghost removed
    in-pr
    on Apr 11, 2023
  7. ghost locked as resolved and limited conversation to collaborators on May 11, 2023
  8. agocke commented on Jun 16, 2023

    @agocke
    Member

    /backport to release/7.0-staging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions