-
Notifications
You must be signed in to change notification settings - Fork 0
Add SDK version to template for Visual Studio compatibility #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: JerrettDavis <2610199+JerrettDavis@users.noreply.github.com>
Co-authored-by: JerrettDavis <2610199+JerrettDavis@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes Visual Studio's inability to resolve MSBuild SDKs without explicit versions by adding version information to the template's SDK attribute. The solution implements a pack-time substitution mechanism that automatically injects the correct SDK version into generated projects.
Key Changes
- Template project file modified to use
SDKVERSION_PLACEHOLDERthat gets replaced at template instantiation - Template configuration enhanced with a
SdkVersionsymbol parameter with1.0.0as default - Custom MSBuild tasks added for pack-time substitution and source restoration to maintain placeholders in source files
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/JD.Efcpt.Build.Templates/templates/efcptbuild/EfcptProject.csproj | Changed SDK attribute to include version placeholder for template engine replacement |
| src/JD.Efcpt.Build.Templates/templates/efcptbuild/.template.config/template.json | Added SdkVersion symbol configuration with placeholder replacement definition |
| src/JD.Efcpt.Build.Templates/JD.Efcpt.Build.Templates.csproj | Implemented MSBuild targets with custom inline task for pack-time version substitution and restoration |
| src/JD.Efcpt.Build.Tasks/packages.lock.json | Automatic package lock file update with Microsoft.NETFramework.ReferenceAssemblies dependency |
| .gitignore | Added *.bak pattern to exclude backup files created during pack process |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…and backup restoration
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Code Coverage |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #55 +/- ##
==========================================
+ Coverage 79.94% 87.49% +7.55%
==========================================
Files 50 50
Lines 3350 3350
Branches 455 455
==========================================
+ Hits 2678 2931 +253
+ Misses 487 419 -68
+ Partials 185 0 -185
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Visual Studio cannot resolve MSBuild SDKs without explicit versions. The template was generating
<Project Sdk="JD.Efcpt.Sdk">which fails SDK resolution.Changes
<Project Sdk="JD.Efcpt.Sdk/TEMPLATE_SDK_VERSION">with placeholderSdkVersionsymbol withTEMPLATE_SDK_VERSIONas replacement targetPackageVersionduring packImplementation
The substitution target runs before
GenerateNuspec:Generated projects now include:
<Project Sdk="JD.Efcpt.Sdk/0.12.3">(matching template version).Sample projects remain unchanged—they use
global.jsonfor SDK resolution during development.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.