Comments (6)
I took a look at the MSBuild SDK here and I see a direct call to the Exec
task during publishing:
I'd suggest instead of using Exec directly, y'all should make a task deriving from ToolTask
and use the APIs there to safely provide command-line arguments to an executable. This will also give you more control over the way sqlcmd is invoked. A good example of this pattern is the .NET SDK Containerization feature (when run from Visual Studio). We made a Tooltask to wrap invoking a helper executable, and you can see that implementation here.
from msbuild.sdk.sqlproj.
Version 2.6.1 just got released on NuGet.org which contains the fix for this issue.
from msbuild.sdk.sqlproj.
As a work-around for the time being - wrote some PowerShell scripts to pass these SQLCMD
variables in as part of an external SqlPackage
call. I need to do that for some of our deployments anyway, but it'd be great if I could just use the data inside the .csproj
file so I don't have to keep extra external variables lying around
from msbuild.sdk.sqlproj.
@baronfel Interesting, I didn't know about that when I first wrote this. Could be worth investigating I guess, just not sure when I'll find the time to do it though. It also complicates the setup a little bit as currently the SDK is only a bunch of MSBuild files and a command line tool that does the heavy lifting. This would require adding an additional assembly that would contain the MSBuild task. If anyone's up for it and willing to submit a PR that would be great.
To fix @Aaronontheweb's issue though I think we could fix the escaping with the current setup as well, at least regarding any SQLCMD parameters being passed.
from msbuild.sdk.sqlproj.
@Aaronontheweb We have a PR now that should fix this issue.
from msbuild.sdk.sqlproj.
Version 2.6.1 just got released on NuGet.org which contains the fix for this issue.
thank you!
from msbuild.sdk.sqlproj.
Related Issues (20)
- [Question] Is there any plan to add unit testing capabilities to this project? HOT 1
- Build warnings in latest VS HOT 3
- How to reference sql scripts from nuget in Post Deployment Script HOT 2
- Store procedure is not added as part of DACPAC HOT 1
- Dacpac Version HOT 1
- How can you include a script file with external references that aren't referencable? HOT 5
- EXEC warning SQL73162 --> Option TrustServerCertificate is missing HOT 2
- Support for linked servers HOT 5
- Referencing Microsoft.SqlServer.Dacpacs.Master fails HOT 5
- Referencing projects through `.sqlproj` files HOT 2
- Unable to drop tables, functions and procedures HOT 3
- Unrecognized command or argument '-p:UseSharedCompilation=false' when running on Github build HOT 9
- The SDK 'MSBuild.Sdk.SqlProj/2.6.1' specified could not be found HOT 3
- Enable marking individual static analyzer rules as error (instead of warning)
- Latest release notes lack some details (unlike previous) HOT 2
- Error MSB4018: System.NullReferenceException for an OpenJson operation HOT 2
- Add ability to update current rules or bring your own HOT 6
- Problem with CodeAnalysisRules when using ";" (semicolon) HOT 1
- Enable code analysis by default in the templates HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from msbuild.sdk.sqlproj.