fix(dotnet): Embed checksums and fix installer logic#31
fix(dotnet): Embed checksums and fix installer logic#31yyyu-google merged 1 commit intogoogle:mainfrom
Conversation
4bb9264 to
47aa4a6
Compare
47aa4a6 to
97125f6
Compare
| ? 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"; |
There was a problem hiding this comment.
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 --> |
There was a problem hiding this comment.
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> | |||
There was a problem hiding this comment.
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.
…elease metadata