-
Notifications
You must be signed in to change notification settings - Fork 53
Attempt to fix publishing in VS #850
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
Signed-off-by: Jonathan Mezach <jonathan.mezach@rr-wfm.com>
|
@jmezach I tried this locally, publish does nothing - also maybe it should be "true" rather than "True" for consistency |
Signed-off-by: Jonathan Mezach <jonathan.mezach@rr-wfm.com>
|
@ErikEJ I fixed the inconsistency, but I doubt that that is actually fixing something. Might need to get another binary log to figure that out though. But doing that from VS is a bit more involved, see https://github.com/dotnet/msbuild/blob/main/documentation/wiki/Providing-Binary-Logs.md#capturing-binary-logs-through-visual-studio. |
|
@jmezach Correct, the inconsistency fixed nothing, I will try to get a VS binary log |
Signed-off-by: Jonathan Mezach <jonathan.mezach@rr-wfm.com>
|
@ErikEJ I made another change, can you gave that a shot? If that still doesn't work I might have to fire up a machine with Visual Studio installed :P |
|
Same issue: Build started at 12:04...
1>------ Build started: Project: TestProject, Configuration: Release Any CPU ------
1>Using target framework net8.0 to run DacpacTool
1>TestProject -> C:\dev\GitHub\MsBuild.Sdk.SqlProj.Origin\test\TestProject\bin\Release\net8.0\TestProject.dacpac
2>------ Publish started: Project: TestProject, Configuration: Release Any CPU ------
2>Using target framework net8.0 to run DacpacTool
2>TestProject -> C:\dev\GitHub\MsBuild.Sdk.SqlProj.Origin\test\TestProject\bin\Release\net8.0\TestProject.dacpac
2>TestProject -> C:\dev\GitHub\MsBuild.Sdk.SqlProj.Origin\test\TestProject\bin\Release\net8.0\publish\
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 12:04 and took 02,843 seconds ==========
========== Publish: 1 succeeded, 0 failed, 0 skipped ==========
========== Publish completed at 12:04 and took 02,845 seconds ==========
|
|
@jmezach I have sent a Windows binary log |
|
@ErikEJ I've got a fix now that works with VS. Only thing I'm a bit on the fence about now is whether we should have |
|
@jmezach Publish normally means prepare the deployment - "Publishes the application and its dependencies to a folder for deployment to a hosting system." In our case, it is basically the same as build as far as I can tell. So probably do nothing ? |
Add test project to solution
|
@jmezach I will do some smoke testing again this evening |
|
@jmezach Confirmed that this works! 🥂 |
ErikEJ
left a comment
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.
LGTM
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 restores Visual Studio publish functionality for database projects by introducing a custom Publish target that conditionally includes the PublishDatabase target when building inside Visual Studio. Additionally, the solution file format is migrated from the classic .sln format to the newer .slnx XML format.
Changes:
- Added a
Publishtarget with configurable dependencies that includesPublishDatabasewhen executed from Visual Studio - Replaced the traditional
.slnfile with a new.slnxXML-based solution file - Modified
PublishDependsOnproperty to control publish behavior in different contexts
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/MSBuild.Sdk.SqlProj/Sdk/Sdk.targets | Added Publish target and configured PublishDependsOn to restore database publishing in Visual Studio |
| MSBuild.Sdk.SqlProj.slnx | New XML-based solution file with project and folder structure |
| MSBuild.Sdk.SqlProj.sln | Removed classic solution file in favor of .slnx format |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@jeffrosenberg Can you have a look at this as well? |
|
@ErikEJ @jeffrosenberg Maybe we should just merge this? |
|
@jmezach agree |
Hopefully this will make sure that using the Publish option in Visual Studio will still publish the database as we did in previous versions of MSBuild.Sdk.SqlProj (prior to 4.0.0).
fixes #849
fixes #851