Search code examples
c#visual-studio64-bitemulationarm64

SqlServerTypes on Windows ARM (arm64)


I'm a fullstack developer and I had the setup where my main development machine was an Intel MacBook for frontend iOS/Android app development, with Windows 10 running in a Parallels VM, with Visual Studio installed for my .NET (Standard) backend. Everything was running fine with this setup.

I've just moved to an M1 MacBook and since I couldn't use Windows 10 x64 anymore, I've setup Windows 11 ARM version, and installed Visual Studio 2022 in it. Visual Studio works perfectly under x64 emulation, but some code in my C# projects have Entity Framework dependencies for custom SQL Server types (spatial types), which have x86/x64 DLLs available (the package was last updated on 2018 and I couldn't find any ARM64 versions). Even though x64 emulation works great when running apps like Visual Studio itself, for some reason I'm getting the following error when I'm building a project which depend on SQL Server Types:

Error       Could not copy the file "C:\Users\can\source\repos\MyProjectNameRedacted\SqlServerTypes\x86\SqlServerSpatial140.dll" because it was not found.          
Error       Could not copy the file "C:\Users\can\source\repos\MyProjectNameRedacted\SqlServerTypes\x64\SqlServerSpatial140.dll" because it was not found.          
Error       Could not copy the file "C:\Users\can\source\repos\MyProjectNameRedacted\SqlServerTypes\x86\msvcr120.dll" because it was not found.         
Error       Could not copy the file "C:\Users\can\source\repos\MyProjectNameRedacted\SqlServerTypes\x64\msvcr120.dll" because it was not found.                     

How can I solve this?


Solution

  • The problem was simpler and more obvious than anything to do with ARM64 or emulation.

    I've cloned my repo from Git, and my .gitignore simply was ignoring DLL files as all the DLLs except these particular files were just build outputs. When I cloned the repo, DLLs were simply not there, and build was expecting those DLLs, resulting in error. I've reinstalled the package using NuGet using the following command and the problem was solved:

    Install-Package Microsoft.SqlServer.Types -Version 14.0.1016.290 -project Models