简体   繁体   English

在 M1 Mac 上的 Azure Data Studio 中构建 SQL 服务器数据库项目真的是不可能的吗?

[英]Is it literally impossible to build a SQL Server database project in Azure Data Studio on an M1 Mac?

I'm attempting to set myself up with Azure Data Studio on my new M1 Mac Mini, but the SQL Server database project I'm working on refuses to build.我正在尝试在我的新 M1 Mac Mini 上设置 Azure Data Studio,但我正在处理的 SQL 服务器数据库项目拒绝构建。 This is the (completely useless) error I'm getting:这是我得到的(完全没用的)错误:

stdout: /Users/dumasded/.azuredatastudio/extensions/microsoft.sql-database-projects-0.13.0/BuildDirectory/Microsoft.Data.Tools.Schema.SqlTasks.targets(586,5): error MSB4181: The "SqlBuildTask" task returned false but did not log an error. [/Users/dumasded/Projects/db-project/DBProject.sqlproj]
stdout:     0 Warning(s)
stdout:     1 Error(s)

I can neither find nor remember where I got this idea but I somehow got it into my head that this has something to do with the version of the SDK I'm using - I'm currently using 6.0.100, which as far as I can tell is the only one that's arm64 compatible.我既找不到也不记得我是从哪里得到这个想法的,但我不知怎么想到这与我正在使用的 SDK 的版本有关——我目前使用的是 6.0.100,据我所知can tell 是唯一一个兼容 arm64 的。 Every attempt I've made to download, install and run an earlier version of the SDK on this machine has failed.我在这台机器上下载、安装和运行早期版本的 SDK 的每一次尝试都失败了。 If that is in fact the problem, I can't even get far enough to find out.如果这确实是问题所在,我什至无法找到足够的距离。

Just to be sure it wasn't something to do with the existing project I was trying to set up, I created a brand new one from scratch and attempted to build that.为了确保它与我试图建立的现有项目无关,我从头开始创建了一个全新的项目并尝试构建它。 It failed with the same error.它因同样的错误而失败。 It definitely appears to be a system issue and not a project-specific one.这绝对是一个系统问题,而不是特定于项目的问题。

Is there any hope for me?我还有希望吗? Am I doomed to return to working on my crummy Lenovo Thinkpad?我注定要回到我那破烂的联想 Thinkpad 上工作吗? My breath is bated.我喘不过气来。 Thanks in advance.提前致谢。

EDIT编辑

I've just come across the ingenious MSBuild.Sdk.SqlProj as a potential solution to my issue, however my attempts to use it are still running up against SDK version issues:我刚刚遇到巧妙的MSBuild.Sdk.SqlProj作为我的问题的潜在解决方案,但是我尝试使用它仍然遇到 SDK 版本问题:

error : The current SDK bundles target framework 'netcoreapp6.0' which is not supported by MSBuild.Sdk.SqlProj. Either install a .NET Core SDK that supports 2.1, 3.1 or 5.0, or file an issue at https://github.com/rr-wfm/MSBuild.Sdk.SqlProj/ to add support.

This would seem to confirm my initial suspicion that this is an issue of SDK versions.这似乎证实了我最初的怀疑,即这是 SDK 版本的问题。

EDIT 2编辑 2

Neglected to mention that I'm using Azure Data Studio with the SQL Database Projects extension, which purports to handle the DACPAC creation seamlessly and across platforms.没有提到我正在使用 Azure Data Studio 和 SQL 数据库项目扩展,它声称可以跨平台无缝地处理 DACPAC 创建。 Though that hasn't been my experience thus far.尽管到目前为止,这还不是我的经验。

I'll be dunked.我会被扣篮的。 I knew there had to be a deceptively simple answer to this.我知道必须有一个看似简单的答案。

It turns out that my attempts to download, install and run an earlier version of the SDK on my machine weren't failing - they were just going into a different directory.事实证明,我尝试在我的机器上下载、安装和运行早期版本的 SDK并没有失败——它们只是进入了不同的目录。 Apparently, installing x64 SDKs on an arm64 machine results in the SDKs being created in a dedicated 'x64' subdirectory of the primary dotnet installation.显然,在 arm64 机器上安装 x64 SDK 会导致在主 dotnet 安装的专用“x64”子目录中创建 SDK。 This is painfully obvious to me now - the reason dotnet --list-sdks showed no trace of the earlier SDKs was that they were being installed for a completely isolated instance of dotnet.现在这对我来说非常明显 - dotnet --list-sdks没有显示早期 SDK 的痕迹的原因是它们是为完全隔离的 dotnet 实例安装的。 All I had to do was point the SQL Database Projects extension to that instance of dotnet and it started working:我所要做的就是将 SQL 数据库项目扩展指向该 dotnet 实例,它就开始工作了:

SQL 数据库项目:Net Core SDKLocation

I hope my publicly blundering my way through the maze of dotnet SDK architectures manages to help someone else.我希望我在 dotnet SDK 架构迷宫中的公开失误能够帮助其他人。 For my part I'm just so relieved I've finally gotten it to work.就我而言,我很放心,我终于让它工作了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 2022 Mac M1 .NET 6,无法加载文件或程序集 'Microsoft.Build - Visual Studio 2022 Mac M1 .NET 6, Could not load file or assembly 'Microsoft.Build 建立连接到SQL Server的Visual Studio项目? - Build Visual Studio Project that connects to SQL Server? do.net 构建失败,在 mac m1 上出现零错误和警告 - dotnet build failed with zero errors and warnings on mac m1 如何将 ASP.NET Web 应用程序部署到 Azure 与现有的 Z9778840A0104CB30C52ZB7 服务器数据库 (76410CB30C52ZB7) 服务器数据库 - How to deploy an ASP.NET Web App to Azure with an existing SQL Server database (Azure Data Studio) HttpClient 在 Mac M1 上失败 - HttpClient fails on Mac M1 部署在本地SQL Server Management Studio中的Azure数据库的数据库备份 - Database backup of azure database deployed in local sql server management studio 从 Visual Studio 2013 数据库项目中清理 SQL Server 数据库 - Clean SQL Server database from Visual Studio 2013 database project 在Visual Studio中更改SQL Server数据库的最大大小以在Azure中上载 - Changing SQL Server database maximum size in Visual Studio for uploading in Azure Visual Studio - SQL Server 数据库项目的连接字符串 - Visual Studio - Connection String for SQL Server Database Project .NET6 与 Visual Studio for Mac M1 不兼容,我可以为 xamarin 使用什么? - .NET6 not compatible with Visual Studio for Mac M1, what can I use for xamarin?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM