1

I have a solution where my Sagas and hosting are defined in two seperate projects:

Project NSB => Defines class CreateAuthoritySetSaga : SqlSaga<...>

Project Webhost => References project NSB

Webhost assemblyfile defines the PromotionSqlScript generation:

[assembly: NServiceBus.Persistence.Sql.SqlPersistenceSettings(
MsSqlServerScripts = true,
ScriptPromotionPath = "$(SolutionDir)PromotedSqlScripts")]

But when I build the solution, only SQL scripts for "baseline" NServiceBus tables are created (Outbox, Subscription, Timeout). The folder for sagas is empty.

This question Unable to host an NServiceBus Saga from another Service with SQL Persistence suggest to collect SQL output from the separate projects. But isn't there a way to instruct NServiceBus.Persistence.Sql.MSBuild which assemblies to look for sagas?

Carsten Gehling
  • 1,218
  • 1
  • 13
  • 31

1 Answers1

0

The scripts should be generated when your assembly that contains your saga is build. It should use the strategy as mentioned in the other post

See the documentation: https://docs.particular.net/persistence/sql/controlling-script-generation

Earlier a suggestion was mentioned to use "NServiceBus.Persistence.Sql.ScriptBuilder", but this package is not intended for public use!

Ramon Smits
  • 2,482
  • 1
  • 18
  • 20
  • 2
    They ARE created. Problem occurs, if more than one project in the solution has NServiceBus integration. The output folder is cleared before each build, so the second project built will overwrite anything produced by the first project built. Current workaround has been to make each project produce SQL scripts in their own project folder, and then copy all scripts together with a PostBuild task. – Carsten Gehling Jul 06 '18 at 17:41