Skip to content

Instantly share code, notes, and snippets.

View benvillalobos's full-sized avatar

Ben Villalobos benvillalobos

View GitHub Profile
@benvillalobos
benvillalobos / debugging-custom-msbuild-tasks.md
Last active March 31, 2024 00:08
Debugging Custom MSBuild Tasks

Debugging Custom MSBuild Tasks

A brief explanation on debugging msbuild tasks. Anything done on CLI (command-line interface) should be done in a Visual Studio Developer Command Prompt. If you have VS installed, search for "Developer command prompt."

This also works for dotnet builds.

Steps

  1. Have VS open & breakpoint into your custom task.
  2. Open up a developer command prompt.
  3. cd your/project/directory
  4. set MSBUILDDEBUGONSTART=1
@benvillalobos
benvillalobos / timetrialinvestigation.md
Last active February 20, 2024 16:22
gravitorium-2-20

Investigation Notes

Time Trial object is the following:

  1. An object that is anchored at the bottom
  2. A background that has an image
  3. Text which is constantly being modified ----
  4. Note it also exists in a separate canvas
  5. Also note: It exists within DontDestroyOnLoad

References

@benvillalobos
benvillalobos / foo.md
Last active February 15, 2024 18:48
vscode-webview-copy

There is a CopyToClipboard message that the webview sends.

This means the webview needs to send the copy to clipboard message, while sending the contents to copy within the message.

So within a react file I might have access to the window! <- confirmed

Extension sees the rightclick -> Copy command

Extension tells webview to copy via CopyToClipboard

@benvillalobos
benvillalobos / ManifestResourceNaming.md
Last active January 19, 2024 14:48
How MSBuild Manifest Resource Naming Works

Manifest Resource Names and You!

For explicit information on how resource names are chosen, see this dotnet docs issue.

This gist is meant to be a slightly higher level explanation on how resource names are used. Mostly I'm just documenting as much context as possible before I forget.

So we start with some Foo.resx

That Foo.resx will get passed to a few tasks in different forms throughout the build.

Relevant tasks:

@benvillalobos
benvillalobos / response-header-override.md
Created December 8, 2023 22:00
Overriding Response Headers in Chrome or Edge

‎‎​

@benvillalobos
benvillalobos / default.code-profile
Last active August 21, 2023 20:34
default.code-profile
{
"name": "education",
"settings": "{\"settings\":\"{\\n \\\"workbench.statusBar.visible\\\": false,\\n\\t\\\"workbench.layoutControl.enabled\\\": false,\\n \\\"window.title\\\": \\\"VS Code for Education\\\",\\n \\\"window.menuBarVisibility\\\": \\\"toggle\\\",\\n \\\"breadcrumbs.enabled\\\": false,\\n \\\"editor.minimap.enabled\\\": false,\\n \\\"extensions.ignoreRecommendations\\\": true,\\n \\\"editor.inlineSuggest.enabled\\\": true,\\n \\\"editor.fontSize\\\": 15,\\n \\\"editor.lineHeight\\\": 1.75,\\n \\\"python.wasm.runtime\\\": \\\"vscode-edu-py:///\\\"\\n}\"}",
"globalState": "{\"storage\":{\"menu.hiddenCommands\": {\"EditorTitle\":[\"workbench.action.splitEditor\"]},\"workbench.panel.markers.hidden\":\"[{\\\"id\\\":\\\"workbench.panel.markers.view\\\",\\\"isHidden\\\":false}]\",\"workbench.panel.output.hidden\":\"[{\\\"id\\\":\\\"workbench.panel.output\\\",\\\"isHidden\\\":false}]\",\"terminal.hidden\":\"[{\\\"id\\\":\\\"terminal\\\",\\\"isHidden\\\":fals

Including Generated Files Into Your Build

Files that get generated during the build behave differently from static files (eg. source files). For this reason, it's important to understand How MSBuild Builds Projects. I'll cover the main two phases here at a high level.

Evaluation Phase

  • MSBuild reads your project, imports everything, creates Properties, expands globs for Items outside of Targets, and sets up the build process.

Execution Phase

  • MSBuild runs Targets & Tasks with the provided Properties & Items in order to perform the build.

Key Takeaway: Files generated during execution don't exist during evaluation, therefore they aren't included in the build process.

@benvillalobos
benvillalobos / msbuild-targets-best-practices.md
Last active October 6, 2022 17:52
MSBuild Target Ordering Best Practices

If your target is influenced by file state or properties defined/modified by other targets. If so, you have a dependency

AfterTargets || BeforeTargets: ANY TIME x target runs, then run this target.

Beforetargets = publish is effectively equivalent to going over to publish and setting its dependsontargets=publishcontainers.

DependsOnTargets exists for targets that KNOW what they depend on when they are created.

BeforeTargets & AfterTargets are built for targets that were created AFTER certain targets, but need to hook in at specific points

@benvillalobos
benvillalobos / binlog-spelunking.md
Last active September 7, 2022 23:39
Spelunking Through Binlogs

Spelunking Through Binlogs

This stuff ain't easy, so here's a WIP "get you up to speed" doc.

Setup

@benvillalobos
benvillalobos / msbuilddebugcomm.md
Created July 21, 2020 20:29
Debugging Node Communication in MSBuild

Debugging Node Communication in MSBuild

To capture logs of how MSBuild nodes talk to each other:

  1. Set MSBUILDDEBUGCOMM=1
  2. Set MSBUILDDEBUGPATH=<some_folder_path>
  3. Run your scenario
  4. The node communication traces should exist in the folder you specified.