Reputation: 1456
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
Reputation: 1456
Finally, I managed to solve it like this:
Added these 2 connection strings in both web.config & app.config
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