Skip to content

fix(dotnet): Embed checksums and fix installer logic#31

Merged
yyyu-google merged 1 commit intogoogle:mainfrom
yyyu-google:chore/update-readme
Aug 20, 2025
Merged

fix(dotnet): Embed checksums and fix installer logic#31
yyyu-google merged 1 commit intogoogle:mainfrom
yyyu-google:chore/update-readme

Conversation

@yyyu-google
Copy link
Copy Markdown
Collaborator

…elease metadata

@yyyu-google yyyu-google marked this pull request as draft August 19, 2025 22:48
@yyyu-google yyyu-google force-pushed the chore/update-readme branch 2 times, most recently from 4bb9264 to 47aa4a6 Compare August 20, 2025 03:39
@yyyu-google yyyu-google changed the title chore(dotnet): add LICENSE, include README in project and configure r… ix(dotnet): Embed checksums and fix installer logic Aug 20, 2025
@yyyu-google yyyu-google marked this pull request as ready for review August 20, 2025 03:43
@yyyu-google yyyu-google changed the title ix(dotnet): Embed checksums and fix installer logic fix(dotnet): Embed checksums and fix installer logic Aug 20, 2025
? embeddedCandidate
: FindChecksumsJson() ?? throw new FileNotFoundException("Could not locate sdks/typescript/checksums.json in repository parents or embedded in output. Please run this command from within the repo or provide checksums.json manually.");
var assembly = Assembly.GetExecutingAssembly();
var resourceName = "TestServerSdk.checksums.json";
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I tried to make checksums.json an asset file for the runtime, but it brings in lots of brittles in the directory findings. And directory structure may have some subtlety per operating system as well. After many rounds of testing, I decided to embed the checksums.json into the TestServerSdk.dll assembly is the best practice to reduce runtime corruption.

<None Update="checksums.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<!-- ADD this to embed the file directly into the DLL -->
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is where the magic happens. I'd like to keep this code comment so that future maintainers know why this file needs to be a embedded resource instead of a content source.

@@ -4,9 +4,9 @@
<TargetFramework>net8.0</TargetFramework>
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

this project is not used at all during runtime. it is just a useful project for debugging. It provides developer a manual way to download the binary if needed.

@yyyu-google yyyu-google merged commit d06ed2b into google:main Aug 20, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants