fix: restore per-project vCard files#179
Open
alafleur-genetec wants to merge 4 commits into
Open
Conversation
PR #168 moved VCard.cs and VCardReader.cs into Samples/Shared/ and registered them in Shared.projitems, which is imported by every sample project. The two files reference System.Windows.Media.ImageSource (WPF), but ~80 console-style sample projects don't reference WPF assemblies, causing 506 build errors on main. Restoring the pre-#168 layout: - VCard.cs and VCardReader.cs moved back into CardholderFieldsExtractorSample - Copies restored in ImageExtractorSample (the second consumer) - Removed the two VCard entries from Shared.projitems Both consumer projects are SDK-style csprojs that auto-include *.cs at the project root, so no csproj edits are needed. Verified locally: VCard/ImageSource compile errors go from 506 to 0.
Contributor
There was a problem hiding this comment.
Pull request overview
The PR fixes a broken main build by removing the shared VCard.cs / VCardReader.cs entries from Samples/Shared/Shared.projitems and adding per-project copies of both files into ImageExtractorSample and CardholderFieldsExtractorSample. The intent is to make each sample self-contained so the shared-project reference no longer breaks compilation. Note: the PR description only mentions ImageExtractorSample, but the diff also adds the same two files to CardholderFieldsExtractorSample.
Changes:
- Removed
VCard.csandVCardReader.csfrom the shared project items. - Added per-project
VCardandVCardReadertoImageExtractorSample. - Added an identical per-project
VCardandVCardReadertoCardholderFieldsExtractorSample.
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Samples/Shared/Shared.projitems | Drops the shared compile entries for VCard.cs / VCardReader.cs. |
| Samples/Workspace SDK/ImageExtractorSample/VCard.cs | Adds the local VCard data model (proper header + namespace). |
| Samples/Workspace SDK/ImageExtractorSample/VCardReader.cs | Adds the vCard parser; missing standard header/namespace, has regex and format-coverage issues. |
| Samples/Workspace SDK/CardholderFieldsExtractorSample/VCard.cs | Verbatim duplicate of the ImageExtractorSample copy. |
| Samples/Workspace SDK/CardholderFieldsExtractorSample/VCardReader.cs | Verbatim duplicate of the ImageExtractorSample copy; same issues apply. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Builds on the Copilot autofix commits (regex anchor, broader photo patterns) and applies the two findings the autofix did not handle: - Add copyright header and place VCardReader in the Genetec.Dap.CodeSamples namespace. Was in the global namespace, inconsistent with the companion VCard class and the rest of the codebase. - Narrow the photo-decode catch to FormatException, IOException, and NotSupportedException, and log failures to Console.Error instead of silently returning null. Sample users can now see why a photo did not load. Mirrored to the second copy of VCardReader.cs in CardholderFieldsExtractorSample so both consumers stay byte-identical.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
VCardandVCardReaderas sample-local files forImageExtractorSampleso the current main branch build no longer depends on shared WPF-specific source items.Genetec.Dap.CodeSampleswith the standard sample header.Console.Error.CardholderFieldsExtractorSampleso both Workspace samples compile with their own local copies.