Sanushi Salgado
Sanushi Salgado

Reputation: 1456

Visual Studio doesn't show MySQL Database, under data sources when publishing ASP.NET WebAPI project

When publishing a ASP.NET WebAPI project using Web Deploy, you get an option to create a profile. When the create profile button is clicked, you get the Publish wizard. In that wizard, there's an option to select the data source. Under data sources, VS does not display MySQL Database or even NET framework data provider for MySQL.

However, when I'm creating a new ADO.Data entity model using VS, MySQL Database is shown under data sources. Also when creating a new data connection (in server explorer tab), it displays MySQL Database under data sources without no issue, and the connection works fine.

I have installed VS 2017 Community Edition, MySQL.Data 6.10.7, MySQL.Data.Entity 6.10.7, MySQL connector 6.10.7 & MySQL for Visual Studio 1.2.8.

Does anyone know how to fix this issue? I want to select MySQL Database from data sources, for publishing my WebAPI project, since my database is written in MySQL.

Upvotes: 0

Views: 573

Answers (1)

Sanushi Salgado
Sanushi Salgado

Reputation: 1456

Finally, I managed to solve it like this:

  1. Added these 2 connection strings in both web.config & app.config

  2. In the publish wizard directly gave the entity framework DB entities connection string like this

connection string - in Visual Studio publish wizard

Finally the publish was success. After hosting the WebAPI, it was able to retrieve data from MySQL.

Upvotes: 1

Related Questions