Giter Site home page Giter Site logo

Log verbosity about msbuild.sdk.sqlproj HOT 10 CLOSED

rr-wfm avatar rr-wfm commented on May 22, 2024
Log verbosity

from msbuild.sdk.sqlproj.

Comments (10)

molszews avatar molszews commented on May 22, 2024

Seems like sqlproj way of building is automagically inserting GOs between files?

from msbuild.sdk.sqlproj.

jmezach avatar jmezach commented on May 22, 2024

@molszews That's interesting. You don't get this error when building the .dacpac using .sqlproj?

As for some log verbosity, have a look at the output from the Build. It should show you the files being added to the model and will probably give a clue about which file is causing this error.

from msbuild.sdk.sqlproj.

molszews avatar molszews commented on May 22, 2024

I think this is related to PostDeployment scripts, I have many sql files that are not table models but migrations scripts, there is one marked as entry file in sqlproj:
<PostDeploy Include="PostDeployment\runMigrations.sql" />
which then uses sqlcmd syntax to include other files :r .\disableTriggers.sql btw. these are set in sqlproj as <None Include="PostDeployment\disableTriggers.sql" />

when I remove PostDeployment dir with all migration scripts then dacpac builds just fine

from msbuild.sdk.sqlproj.

jmezach avatar jmezach commented on May 22, 2024

Yes, by default we include all .sql files into the compilation, except for those in the folders Post-Deployment and Pre-Deployment (see the ItemGroup here). I believe those are the names of folders that you get when you create a new .sqlproj project.

You could try to rename the PostDeployment folder to Post-Deployment, or you can edit the .csproj and add this to it:

<ItemGroup>
  <Content Exclude="PostDeployment\**\*.sql" />
</ItemGroup>

That will probably fix building the .dacpac, but will probably not include the post deployment scripts you currently have. For that to work we'll probably need to add support for the PostDeploy and PreDeploy build actions somehow.

from msbuild.sdk.sqlproj.

ErikEJ avatar ErikEJ commented on May 22, 2024

I dont think those folders are created by default - just the Postdeploy/Predeploy Build action on the related scripts (and they can also refer to some scripts with build action None)

This file contains SQL statements that will be appended to the build script.		
 Use SQLCMD syntax to include a file in the post-deployment script.			
 Example:      :r .\myfile.sql								

from msbuild.sdk.sqlproj.

jmezach avatar jmezach commented on May 22, 2024

;) Maybe that's just how we've setup our projects. Perhaps we shouldn't exclude those by default anymore, although that would be a breaking change. Either way we'll probably want to add support for post deployment scripts. I'm just not sure how those can be added to the model and if they resolve those references by default or that we need to add some logic to make that happen. That does sound like a different feature than what is being requested here though, so maybe we should open a separate issue.

from msbuild.sdk.sqlproj.

ErikEJ avatar ErikEJ commented on May 22, 2024

Agree, proper support for pre and post is a separate issue.

from msbuild.sdk.sqlproj.

molszews avatar molszews commented on May 22, 2024

ok, seems to me this issue can be closed now

from msbuild.sdk.sqlproj.

molszews avatar molszews commented on May 22, 2024

btw @jmezach any hints re local setup to play with MSBuild.Sdk.Sqlproj locally? I mean, other way than publishing nuget package

from msbuild.sdk.sqlproj.

jmezach avatar jmezach commented on May 22, 2024

Have a look at the test projects. They mostly just include the Sdk.props and Sdk.targets files directly which should work if you want to try out changes locally.

from msbuild.sdk.sqlproj.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.