I am running Windows 11 ARM on my Macbook with M1 processor using Parallels. I can connect to my SQL Server Express database from development tools like Visual Studio (ARM) and Rider (ARM). Also running a WPF application connecting to the database is no problem.
But if a run a website which wants to connect using the exact same connection string I'm getting the following error:
System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 56 - Unable to load the SQLUserInstance.dll from the location specified in the registry. Verify that the Local Database Runtime feature of SQL Server Express is properly installed.)
System.ComponentModel.Win32Exception (0x80004005): %1 is not a valid Win32 application
My website is running on .NET framework 4.6.1
Connection string: <add name="DefaultConnection" connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\XXX.mdf;Initial Catalog=XXX;Integrated Security=True" providerName="System.Data.SqlClient" />
I tried everything now but without result :)