SQL Persistence: Odd Disappearing Scripts

Hello All,

NSB version 7.5
NServiceBus.Persistence.SQL version 6.2
NServiceBus/SqlServer version 6.3.1

We’re seeing an odd problem with scripts being deleted when we run the project without building.

Any time sources change and we build the project, the operational scripts are generated successfully to the bin\Debug\NServiceBus.Persistence.Sql\MsSqlServer directory.

If we run the project without needing to build/rebuild, the scripts disappear immediately, even before any of our startup breakpoints get hit.

This is causing us to get the following error (EnableInstallers() is being used in our startup code):

Expected ‘C:\xxxxx\bin\Debug\NServiceBus.Persistence.Sql\MsSqlServer\Subscription_Create.sql’ to exist. It is possible it was not deployed with the endpoint.

. . . at ScriptLocation.ValidateScriptExists(String createScript) in /_/src/SqlPersistence/ScriptLocation.cs:line 32 . . .

Is this expected behavior? Is there anything we can do to cause the script removal to be skipped?

Let me know if any additional info would be helpful.



Any thoughts on this? Would repro code help?

Hey @Phil_Sandler,

Yeah I think we would need a repro to investigate this. I just tried with a .NET Framework 4.8 console app using a non-SDK style project (with packages.config, which is what I am guessing you are using given the lack of a framework in your debug path) and was not able to reproduce the problem.

Thanks David, we’ll work on reproducing in a test project.


It appears to be related to this MSBuild bug:

So . . . unrelated to NSB. Thanks for your help!