Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Allow for specifying multiple SqlServerVersions on single project #278

Open
sykesjd opened this issue Apr 7, 2022 · 6 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@sykesjd
Copy link

sykesjd commented Apr 7, 2022

The .NET SDK csproj standard allows for specifying a multi-value TargetFrameworks property as an alternative to the single-value TargetFramework property, e.g.:

<PropertyGroup>
  <TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
</PropertyGroup>

With the above, building the project would produce DLLs for all three frameworks specified.

In the same vein, this sqlproj SDK standard should ideally allow for specifying a multi-value SqlServerVersions property as an alternative to the single-value SqlServerVersion property, e.g.:

<PropertyGroup>
  <TargetFramework>net6.0</TargetFramework>
  <SqlServerVersions>Sql130;SqlAzure</SqlServerVersions>
</PropertyGroup>

The above addition should allow for building the same sqlproj project against multiple SQL Server versions with one build command, which would as a result allow for deploying the same database schema to both an on-premise database and an Azure SQL database (as in the example above) without having to maintain two separate projects that are identical in every regard except for the SqlServerVersion.

@jmezach jmezach added enhancement New feature or request help wanted Extra attention is needed labels Apr 8, 2022
@jmezach
Copy link
Member

jmezach commented Apr 8, 2022

Thank you for your suggestions @sykesjd. I think this would be a great addition and I can see the value in it. If anyone is willing to implement this we would gladly take a PR for it. Not sure when I'll get around to implementing this myself.

@ErikEJ
Copy link
Collaborator

ErikEJ commented Nov 22, 2022

@sykesjd I have no issues with deployment to my localDb when SqlServerVersion is SqlAzure.

@sykesjd
Copy link
Author

sykesjd commented Nov 22, 2022

@sykesjd I have no issues with deployment to my localDb when SqlServerVersion is SqlAzure.

No, but you can't deploy a dacpac targeting SqlAzure to an on-premise SQL Server instance - one of the teams where I work found that out the hard way.

@ErikEJ
Copy link
Collaborator

ErikEJ commented Nov 22, 2022

LocalDB is an "on-premise SQL Server instance" - which SQL version were being deployed to?

@sykesjd
Copy link
Author

sykesjd commented Nov 22, 2022

LocalDB is an "on-premise SQL Server instance" - which SQL version were being deployed to?

If memory serves, it was a SQL Server 2016 instance.

To clarify, the scenario I mentioned dealt with an actual sqlproj project rather than one of these SDK projects.

@ErikEJ
Copy link
Collaborator

ErikEJ commented Nov 27, 2022

You can just use the /p:AllowIncompatiblePlatform=true option when publishing @jmezach FYI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants