René's URL Explorer Experiment


Title: Fix potential Serilog load error, enable debug logging into msbuild by wherget · Pull Request #40 · EvaisaDev/UnityNetcodePatcher · GitHub

Open Graph Title: Fix potential Serilog load error, enable debug logging into msbuild by wherget · Pull Request #40 · EvaisaDev/UnityNetcodePatcher

X Title: Fix potential Serilog load error, enable debug logging into msbuild by wherget · Pull Request #40 · EvaisaDev/UnityNetcodePatcher

Description: As is, Default.LoadFromAssemblyName may fail to load the Serilog dependency when using the MSBuild SDK, leading to exceptions like: Sdk.targets(6,5): error : [15:53:41 FTL] Netcode patching failed! Sdk.targets(6,5): error : System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. Sdk.targets(6,5): error : at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr) Sdk.targets(6,5): error : at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) Sdk.targets(6,5): error : at NetcodePatcher.MSBuild.NetcodePatchTask.<>c__DisplayClass32_0.g__RunPatch|0(ITaskItem patchSpecifier) in /home/runner/work/UnityNetcodePatcher/UnityNetcodePatcher/NetcodePatcher.MSBuild.Tasks/NetcodePatchTask.cs:line 96 Sdk.targets(6,5): error : at NetcodePatcher.MSBuild.NetcodePatchTask.Execute() in /home/runner/work/UnityNetcodePatcher/UnityNetcodePatcher/NetcodePatcher.MSBuild.Tasks/NetcodePatchTask.cs:line 105 Sdk.targets(6,5): error : Caused by: System.IO.FileNotFoundException: Could not load file or assembly 'Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10'. The system cannot find the file specified. Sdk.targets(6,5): error : Sdk.targets(6,5): error : at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) Sdk.targets(6,5): error : at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr) Sdk.targets(6,5): error : Caused by: System.IO.FileNotFoundException: Could not load file or assembly 'Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10'. The system cannot find the file specified. Sdk.targets(6,5): error : Sdk.targets(6,5): error : at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext, RuntimeAssembly requestingAssembly, Boolean throwOnFileNotFound) Sdk.targets(6,5): error : at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyName(AssemblyName assemblyName) Sdk.targets(6,5): error : at NetcodePatcher.Tools.Common.PatcherLoadContext.Load(AssemblyName assemblyName) in /home/runner/work/UnityNetcodePatcher/UnityNetcodePatcher/NetcodePatcher.Tools.Common/PatcherLoadContext.cs:line 30 Sdk.targets(6,5): error : at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingLoad(AssemblyName assemblyName) Sdk.targets(6,5): error : at System.Runtime.Loader.AssemblyLoadContext.Resolve(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName) This PR adds code to attempt to manually resolve the assembly from the PatcherCommonAssemblyDir before deferring to the Default Context. Additionally it changes the LoggingConfiguarion for the MSBuild Task to also emit Debug messages. These are only shown when MSBuild'ing with verbosity detailed or higher anyway, but filtering them out in the Task leaves them completely inaccessible.

Open Graph Description: As is, Default.LoadFromAssemblyName may fail to load the Serilog dependency when using the MSBuild SDK, leading to exceptions like: Sdk.targets(6,5): error : [15:53:41 FTL] Netcode patching failed!...

X Description: As is, Default.LoadFromAssemblyName may fail to load the Serilog dependency when using the MSBuild SDK, leading to exceptions like: Sdk.targets(6,5): error : [15:53:41 FTL] Netcode patching failed!...

Opengraph URL: https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:f4bbb10d-4e01-6b9f-9ecd-1de0152139f6
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBA1C:1F2B93:7BCAF:A68AB:6A62858B
html-safe-nonce8b8529f65f61ce7e19e068238b1fdc77e6e029a607ea45bf9e150e593bf6998a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTFDOjFGMkI5Mzo3QkNBRjpBNjhBQjo2QTYyODU4QiIsInZpc2l0b3JfaWQiOiI2ODI2ODg3NzI2MDc4NTI2ODU5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac15b7d9a9dcc00621fdc1292b0fd3179d364e96de15c291c799c35f412455ce49
hovercard-subject-tagpull_request:1878461244
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/files
twitter:imagehttps://avatars.githubusercontent.com/u/806327?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/806327?s=400&v=4
og:image:altAs is, Default.LoadFromAssemblyName may fail to load the Serilog dependency when using the MSBuild SDK, leading to exceptions like: Sdk.targets(6,5): error : [15:53:41 FTL] Netcode patching failed!...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None7a4ef49a11a2c05de16a801b29c54a151d2e3262d6fd17381ca13b5ae25dda8f
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/EvaisaDev/UnityNetcodePatcher git https://github.com/EvaisaDev/UnityNetcodePatcher.git
octolytics-dimension-user_id27735599
octolytics-dimension-user_loginEvaisaDev
octolytics-dimension-repository_id720491404
octolytics-dimension-repository_nwoEvaisaDev/UnityNetcodePatcher
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id720491404
octolytics-dimension-repository_network_root_nwoEvaisaDev/UnityNetcodePatcher
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release97b18c8f1d2683a31995fd6e802daf9bf0d4d3f0
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FEvaisaDev%2FUnityNetcodePatcher%2Fpull%2F40%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FEvaisaDev%2FUnityNetcodePatcher%2Fpull%2F40%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=EvaisaDev%2FUnityNetcodePatcher
Reloadhttps://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/files
Reloadhttps://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/files
Reloadhttps://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/files
EvaisaDev https://github.com/EvaisaDev
UnityNetcodePatcherhttps://github.com/EvaisaDev/UnityNetcodePatcher
Notifications https://github.com/login?return_to=%2FEvaisaDev%2FUnityNetcodePatcher
Fork 7 https://github.com/login?return_to=%2FEvaisaDev%2FUnityNetcodePatcher
Star 54 https://github.com/login?return_to=%2FEvaisaDev%2FUnityNetcodePatcher
Code https://github.com/EvaisaDev/UnityNetcodePatcher
Issues 2 https://github.com/EvaisaDev/UnityNetcodePatcher/issues
Pull requests 0 https://github.com/EvaisaDev/UnityNetcodePatcher/pulls
Actions https://github.com/EvaisaDev/UnityNetcodePatcher/actions
Projects https://github.com/EvaisaDev/UnityNetcodePatcher/projects
Security and quality 0 https://github.com/EvaisaDev/UnityNetcodePatcher/security
Insights https://github.com/EvaisaDev/UnityNetcodePatcher/pulse
Code https://github.com/EvaisaDev/UnityNetcodePatcher
Issues https://github.com/EvaisaDev/UnityNetcodePatcher/issues
Pull requests https://github.com/EvaisaDev/UnityNetcodePatcher/pulls
Actions https://github.com/EvaisaDev/UnityNetcodePatcher/actions
Projects https://github.com/EvaisaDev/UnityNetcodePatcher/projects
Security and quality https://github.com/EvaisaDev/UnityNetcodePatcher/security
Insights https://github.com/EvaisaDev/UnityNetcodePatcher/pulse
Sign up for GitHub https://github.com/signup?return_to=%2FEvaisaDev%2FUnityNetcodePatcher%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FEvaisaDev%2FUnityNetcodePatcher%2Fissues%2Fnew%2Fchoose
Lordfirespeedhttps://github.com/Lordfirespeed
EvaisaDev:mainhttps://github.com/EvaisaDev/UnityNetcodePatcher/tree/main
wherget:msbuild-task-improvementshttps://github.com/wherget/UnityNetcodePatcher/tree/msbuild-task-improvements
Conversation 5 https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40
Commits 6 https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/commits
Checks 0 https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/checks
Files changed https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/files
Please reload this pagehttps://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/files
Fix potential Serilog load error, enable debug logging into msbuild https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/files#top
Show all changes 6 commits https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/files
6a71099 default to emitting debug logs as they get filtered out on msbuild level wherget May 20, 2024 https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/commits/6a710995701d578727455eb81016d22b05221189
c0941c4 try to resolve shared dependency from path before deferring to system wherget May 20, 2024 https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/commits/c0941c4ef733deacbf7c34421923c427219be65f
cc8e5f6 remove redundant else block after early return wherget Jun 22, 2024 https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/commits/cc8e5f6584b1c3514f2fad6a5b15fab201c2423c
eb1a778 load shared assembly into Default AssemblyLoadContext wherget Jun 22, 2024 https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/commits/eb1a77891d86f6a130a70cbd838279c9437fbee5
9512f15 exit early when there are no targets to patch wherget Jun 22, 2024 https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/commits/9512f15e1219565b2dcb3e36ce7d198256bad489
31788ba add a message for each file that is being processed wherget Jun 22, 2024 https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/commits/31788ba8162925994dd93e5489bf96617107cdc3
Clear filters https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/files
Please reload this pagehttps://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/files
Please reload this pagehttps://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/files
NetcodePatchTask.cs https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/files#diff-48a4823eabc2e66f4e0e67bb656a6662889f0284f0eb2daf5e7bab58f98ee33d
PatcherLoadContext.cs https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/files#diff-fa7dd9e5798ee964029745ace5233a0dc3b48b8a3ac2a1e8b987722c8024a7b5
NetcodePatcher.MSBuild.Tasks/NetcodePatchTask.cshttps://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/files#diff-48a4823eabc2e66f4e0e67bb656a6662889f0284f0eb2daf5e7bab58f98ee33d
View file https://github.com/wherget/UnityNetcodePatcher/blob/31788ba8162925994dd93e5489bf96617107cdc3/NetcodePatcher.MSBuild.Tasks/NetcodePatchTask.cs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/{{ revealButtonHref }}
https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/files#diff-48a4823eabc2e66f4e0e67bb656a6662889f0284f0eb2daf5e7bab58f98ee33d
https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/files#diff-48a4823eabc2e66f4e0e67bb656a6662889f0284f0eb2daf5e7bab58f98ee33d
https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/files#diff-48a4823eabc2e66f4e0e67bb656a6662889f0284f0eb2daf5e7bab58f98ee33d
https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/files#diff-48a4823eabc2e66f4e0e67bb656a6662889f0284f0eb2daf5e7bab58f98ee33d
https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/files#diff-48a4823eabc2e66f4e0e67bb656a6662889f0284f0eb2daf5e7bab58f98ee33d
NetcodePatcher.Tools.Common/PatcherLoadContext.cshttps://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/files#diff-fa7dd9e5798ee964029745ace5233a0dc3b48b8a3ac2a1e8b987722c8024a7b5
View file https://github.com/wherget/UnityNetcodePatcher/blob/31788ba8162925994dd93e5489bf96617107cdc3/NetcodePatcher.Tools.Common/PatcherLoadContext.cs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/{{ revealButtonHref }}
https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/files#diff-fa7dd9e5798ee964029745ace5233a0dc3b48b8a3ac2a1e8b987722c8024a7b5
https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/files#diff-fa7dd9e5798ee964029745ace5233a0dc3b48b8a3ac2a1e8b987722c8024a7b5
https://github.com/EvaisaDev/UnityNetcodePatcher/pull/40/files#diff-fa7dd9e5798ee964029745ace5233a0dc3b48b8a3ac2a1e8b987722c8024a7b5
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.