Skip to content

Treat SQL projects as "regular" projects and enable publishing#1124

Draft
jmezach wants to merge 1 commit intoCommunityToolkit:mainfrom
rr-wfm:feature/sql-projects-publish
Draft

Treat SQL projects as "regular" projects and enable publishing#1124
jmezach wants to merge 1 commit intoCommunityToolkit:mainfrom
rr-wfm:feature/sql-projects-publish

Conversation

@jmezach
Copy link
Contributor

@jmezach jmezach commented Feb 4, 2026

Closes #<ISSUE_NUMBER>

PR Checklist

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • New integration
    • Docs are written
    • Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that)
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs
  • Code follows all style conventions

Other information

Signed-off-by: Jonathan Mezach <jonathan.mezach@rr-wfm.com>
@jmezach
Copy link
Contributor Author

jmezach commented Feb 4, 2026

@ErikEJ One aspect of this is of course that this requires the referenced MSBuild.Sdk.SqlProj to target at least version 4.0. If you don't you get a fairly generic message stating that the dotnet publish failed with a non-zero exit code

@ErikEJ
Copy link
Contributor

ErikEJ commented Feb 4, 2026

@jmezach Could we detect the SDK version in use?

@jmezach
Copy link
Contributor Author

jmezach commented Feb 5, 2026

@ErikEJ We are already reading MSBuild properties from the project file, so I guess we could use that to detect the SDK version. Although I'm not sure if we're currently setting an MSBuild property in Sdk.props that contains the version. Perhaps MSBuild already does so since it has to resolve the SDK anyway, but I'm not sure.

Also have some failing tests know that I have to figure out ;).

@jmezach
Copy link
Contributor Author

jmezach commented Feb 5, 2026

It appears that inheriting our SqlProjectResource from ProjectResource is also opting us into some other behaviours in Aspire that don't translate very well to SQL projects. For example I'm now seeing this:

 Unable to proceed with project '/Users/jmezach/Code/open-source/rr-wfm/CommunityToolkit.Aspire/examples/sql-database-projects/SdkProject/SdkProject.csproj'.
 Ensure you have a runnable project type.
 A runnable project should target a runnable TFM (for instance, net10.0) and have OutputType 'Exe'.
 The current OutputType is 'Library'.

Fun fact is that after that I'm seeing our regular output of actually deploying the project to the database so it seems that there are now two things happening when you start the resource.

@ErikEJ Maybe this isn't the right approach?

@ErikEJ
Copy link
Contributor

ErikEJ commented Feb 5, 2026

@jmezach yeah, I am not sure this is the right approach, I think an Aspire project resource is considered "executable" - maybe @DamianEdwards or @davidfowl are able to assist here? 🙏

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