NServiceBus.Persistence.Sql.MSBuild does not create saga sql scripts from referenced assemblies

964 views Asked by At

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?

1

There are 1 answers

1
Ramon Smits On

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!