C# Can';t在MacOS 10.15中使用dbfirst通过efcore(3.0)生成db模型

C# Can';t在MacOS 10.15中使用dbfirst通过efcore(3.0)生成db模型,c#,visual-studio-code,macos-catalina,entity-framework-core-3.0,C#,Visual Studio Code,Macos Catalina,Entity Framework Core 3.0,这是否可能是因为mac os 10.15不再支持32位,但当我试图生成db模型(dbfirst)文件时,因为它使用32位程序 下面是一个例子: % dotnet ef dbcontext scaffold "server=localhost;uid=root;pwd=xxxxxxxx;port=3306;database=xxxxxx;" MySql.Data.EntityFrameworkCore -o Models -f System.ComponentModel.Win32Excepti

这是否可能是因为mac os 10.15不再支持32位,但当我试图生成db模型(dbfirst)文件时,因为它使用32位程序

下面是一个例子:

% dotnet ef dbcontext scaffold "server=localhost;uid=root;pwd=xxxxxxxx;port=3306;database=xxxxxx;" MySql.Data.EntityFrameworkCore -o Models -f

System.ComponentModel.Win32Exception (2): No such file or directory
   at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at Microsoft.EntityFrameworkCore.Tools.Exe.Run(String executable, IReadOnlyList`1 args, String workingDirectory, Boolean interceptOutput)
   at Microsoft.EntityFrameworkCore.Tools.Project.FromFile(String file, String buildExtensionsDir, String framework, String configuration, String runtime)
   at Microsoft.EntityFrameworkCore.Tools.RootCommand.Execute()
   at Microsoft.EntityFrameworkCore.Tools.Commands.CommandBase.<>c__DisplayClass0_0.<Configure>b__0()
   at Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(String[] args)
   at Microsoft.EntityFrameworkCore.Tools.Program.Main(String[] args)
No such file or directory
%dotnet ef dbcontext scaffold“server=localhost;uid=root;pwd=xxxxxxxx;port=3306;database=xxxxxx;”MySql.Data.EntityFrameworkCore-o Models-f
System.ComponentModel.Win32Exception(2):没有这样的文件或目录
在System.Diagnostics.Process.ForkAndExecProcess(字符串文件名、字符串[]argv、字符串[]envp、字符串cwd、布尔重定向stdin、布尔重定向stdout、布尔重定向stderr、布尔设置凭据、UInt32用户ID、UInt32 groupId、UInt32[]组、Int32&stdinFd、Int32&stderrFd、布尔usesTerminal、布尔throwOnNoExec)
在System.Diagnostics.Process.StartCore(ProcessStartInfo-startInfo)
在System.Diagnostics.Process.Start()中
在System.Diagnostics.Process.Start(ProcessStartInfo-startInfo)
在Microsoft.EntityFrameworkCore.Tools.Exe.Run(字符串可执行文件,IReadOnlyList`1参数,字符串工作目录,布尔输出)
位于Microsoft.EntityFrameworkCore.Tools.Project.FromFile(字符串文件、字符串构建扩展目录、字符串框架、字符串配置、字符串运行时)
在Microsoft.EntityFrameworkCore.Tools.RootCommand.Execute()中
在Microsoft.EntityFrameworkCore.Tools.Commands.CommandBase.c__DisplayClass0_0.b_0()中
在Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(字符串[]args)
位于Microsoft.EntityFrameworkCore.Tools.Program.Main(字符串[]args)
没有这样的文件或目录

此问题可能已在此版本中得到解决
(3.0.100-preview5-011562

Win32与32位或64位操作系统没有任何关系,但我明白你为什么会这样想。名称可能是骗人的。Win32是一些例外情况的包装类。通过它,你可以访问名为NativeError的代码,这是一个32位整数。这就是为什么它被称为Win32.64位operating系统仍然可以处理32位整数

它是一个系统异常类,在某些操作出错时使用。这些操作通常涉及系统级调用,如打开文件或进程

修复是针对权限问题的,不是这个问题,只是尝试升级.NET Core,看看是否有帮助

在此处查找问题并请求修复

问题:

修正:

对于您的问题,我怀疑您已升级到64位MACOS,但在此过程中,您的.NET版本32/64位与您的某些软件包之间存在差异

请删除您的全局nuget,并确保您有64位.NET和64位二进制文件。否则,有一种称为
文件系统重定向的东西,它可能会尝试将您的32位二进制文件与相关的32位二进制文件相匹配,如果您升级了.NET或包,这些文件可能不存在