1

I tried to add ASP.NET Identity to my Web API 2 project. The rest service works fine but whenever I try to register (at http://localhost:3216/Account/Register) this happens:

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: 26 - Error Locating Server/Instance Specified)

there it happens:

 var result = await UserManager.CreateAsync(user, model.Password);

If you need further information about the code feel free to ask but at the moment I dont know what code snippets could help you.

Best regards!

1
  • Have you opened the firewall ports between the web server and the database server? Commented Mar 27, 2017 at 14:39

1 Answer 1

1

Did you reference the context you used gor the Rest Service?

In the Microsoft example they created another for testing purposes. Just use the same context as for your Rest Service and I should work fine.

Sign up to request clarification or add additional context in comments.

1 Comment

worked for me! thanks I was a bit confused about this... I am new in asp.net :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.