Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Log trace errors to Windows Event Log #6921

Merged
merged 3 commits into from Jun 25, 2019
Merged

Conversation

sdmaclea
Copy link

Draft change to remove GUI dialog and add tracing to Windows Event Log for GUI AppHost

Starting to test now....

I considered enabling the Windows Event Log for all hosts regardless of GUI bit. At this time it seemed more conservative to leave only for AppHost w/ GUI.

@sdmaclea sdmaclea added this to the 3.0 milestone Jun 25, 2019
@sdmaclea sdmaclea self-assigned this Jun 25, 2019
@sdmaclea
Copy link
Author

The description for Event ID 1024 from source StandaloneApp.exe cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event: 

This executable is not bound to a managed DLL to execute. The binding value is: 'c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2'
A fatal error was encountered. This executable was not bound to load a managed DLL.

@sdmaclea
Copy link
Author

sdmaclea commented Jun 25, 2019

I need to add a message list....

src/corehost/corehost.cpp Outdated Show resolved Hide resolved
Use .NET Runtime event messages from mscorree.dll
Enable AppHost logging regardless of GUI bit
Always write errors to stderr too

Modify tests
@sdmaclea
Copy link
Author

This is what it currently will look like ...
image

@sdmaclea
Copy link
Author

sdmaclea commented Jun 25, 2019

arm/arm64 are failing with unresolved symbols

4>corehost.obj : error LNK2019: unresolved external symbol __imp_DeregisterEventSource referenced in function wmain [F:\workspace\_work\1\s\bin\obj\win-arm64.Release\corehost\cli\apphost\apphost.vcxproj] [F:\workspace\_work\1\s\src\corehost\build.proj]
4>corehost.obj : error LNK2019: unresolved external symbol __imp_RegisterEventSourceW referenced in function wmain [F:\workspace\_work\1\s\bin\obj\win-arm64.Release\corehost\cli\apphost\apphost.vcxproj] [F:\workspace\_work\1\s\src\corehost\build.proj]
4>corehost.obj : error LNK2019: unresolved external symbol __imp_ReportEventW referenced in function wmain [F:\workspace\_work\1\s\bin\obj\win-arm64.Release\corehost\cli\apphost\apphost.vcxproj] [F:\workspace\_work\1\s\src\corehost\build.proj]
4>F:\workspace\_work\1\s\bin\obj\win-arm64.Release\corehost\cli\apphost\Release\apphost.exe : fatal error LNK1120: 3 unresolved externals [F:\workspace\_work\1\s\bin\obj\win-arm64.Release\corehost\cli\apphost\apphost.vcxproj] [F:\workspace\_work\1\s\src\corehost\build.proj]
corehost.obj : error LNK2019: unresolved external symbol __imp_DeregisterEventSource referenced in function wmain [F:\workspace\_work\1\s\bin\obj\win-arm64.Release\corehost\cli\apphost\apphost.vcxproj] [F:\workspace\_work\1\s\src\corehost\build.proj]
corehost.obj : error LNK2019: unresolved external symbol __imp_RegisterEventSourceW referenced in function wmain [F:\workspace\_work\1\s\bin\obj\win-arm64.Release\corehost\cli\apphost\apphost.vcxproj] [F:\workspace\_work\1\s\src\corehost\build.proj]
corehost.obj : error LNK2019: unresolved external symbol __imp_ReportEventW referenced in function wmain [F:\workspace\_work\1\s\bin\obj\win-arm64.Release\corehost\cli\apphost\apphost.vcxproj] [F:\workspace\_work\1\s\src\corehost\build.proj]
F:\workspace\_work\1\s\bin\obj\win-arm64.Release\corehost\cli\apphost\Release\apphost.exe : fatal error LNK1120: 3 unresolved externals [F:\workspace\_work\1\s\bin\obj\win-arm64.Release\corehost\cli\apphost\apphost.vcxproj] [F:\workspace\_work\1\s\src\corehost\build.proj]
F:\workspace\_work\1\s\src\corehost\build.proj(74,5): error MSB3073: The command "F:\workspace\_work\1\s\src\corehost\build.cmd Release arm64 apphostver 3.0.0-preview7-27825-18 hostver 3.0.0-preview7-27825-18 fxrver 3.0.0-preview7-27825-18 policyver 3.0.0-preview7-27825-18 commit d04ab337fb387e8d705620b8974113e2fe53eff5 rid win-arm64 portable" exited with code 1.

Probably need an extra library reference for these platforms. Not sure which one yet...

Looks like it needed a Advapi32.lib reference.

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@sdmaclea sdmaclea merged commit ea3f1f8 into dotnet:master Jun 25, 2019
@sdmaclea sdmaclea deleted the EventLog branch June 25, 2019 22:10
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* Log trace errors to Windows Event Log

Use .NET Runtime event messages from mscorree.dll
Enable AppHost logging regardless of GUI bit
Always write errors to stderr too
Add apphost Advapi32.lib reference
Modify tests

Fixes & PR feedback


Commit migrated from dotnet/core-setup@ea3f1f8
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants