Skip to content

Conversation

@sschutten
Copy link
Contributor

@sschutten sschutten commented Mar 25, 2025

Closes #590

This change takes the assembly calling the AddSqlProject extension method for determining the build configuration. The AddSqlProject extension method is usually called from the AppHost project and is used to more reliably determine the build configuration. This works for both during running the AppHost as well as during integration testing.

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

This is my first contribution to this project. Please let me know things I should improve!

@sschutten
Copy link
Contributor Author

@dotnet-policy-service agree

@jmezach
Copy link
Contributor

jmezach commented Mar 25, 2025

@ErikEJ We should have a look at this. We've been going back and forth on what assembly to use for determining the configuration quite a bit. I still think we should use typeof(TProject).Assembly.

@ErikEJ
Copy link
Contributor

ErikEJ commented Mar 25, 2025

@jmezach Not sure why this was needed at all in the first place, tbh

@ErikEJ
Copy link
Contributor

ErikEJ commented Mar 25, 2025

@jmezach And how would you get the assembly from TProject?

@jmezach
Copy link
Contributor

jmezach commented Mar 25, 2025

@ErikEJ I believe the main issue was with the CI pipeline of this project itself. The CI was building the referenced MSBuild.Sdk.SqlProj with configuration Release, so when running the tests we couldn't find the .dacpac.

As for how we get the assembly of the TProject, I believe typeof(TProject).Assembly) should just work?

@sschutten
Copy link
Contributor Author

@jmezach I guess that could work too, for the generic AddSqlProject. But what about the non-generic AddSqlProject, how would that work? Or should there always be a TProject annotation that we could look at?

@ErikEJ
Copy link
Contributor

ErikEJ commented Mar 25, 2025

@sschutten Have you smoke tested the latest change?

@sschutten
Copy link
Contributor Author

@ErikEJ Yes, all integration tests pass and I can confirm this works in my solution during runtime and during integration tests.

@ErikEJ
Copy link
Contributor

ErikEJ commented Mar 25, 2025

@sschutten OK, I have kicked in the CI build now

@ErikEJ
Copy link
Contributor

ErikEJ commented Mar 25, 2025

I have tested the Nuget package from the CI build on one of our "production" solutions, and it works as expected.

Copy link
Contributor

@jmezach jmezach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

[BUG] SQL Projects publishing broken in 9.3 during integration testing

4 participants