I have an Actor that after receiving a request from a WebAPI project, Actor queries a table using Entity Framework 6.
using (var context = new MetadataContext()) { var userStorageAccountId = context.Set<UsersToStorageAccounts>() .Find(userId).StorageAccountId; }
The database was successfully created using the "Add-Migration" .. "Update-Database" commands and has the following connection string:
@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFileName=C:\Users\xxxx\Metadata.mdf;Connect Timeout=30;Initial Catalog=Metadata;Integrated Security=True;"
When I start the fabric service and the actor tries to access the context, I get the following exception:
When connecting to SQL Server, a network-related or specific instance error occurred. The server was not found or was not available. Verify the instance name is correct and configure SQL Server to connect remotely. (provider: SQL Network Interfaces, error: 50 - A local database error has occurred. Unable to create an automatic instance. For error information, see the Windows application event log.)
and event viewer error:
Unable to get local application data path. Most likely, the user profile is not loaded. If LocalDB is running in IIS, verify that profile loading is enabled for the current user.
I was looking for a way to load a user profile, but I found solutions for IIS.
Please, help:)
source share